PDA

View Full Version : Myspace.cgi help



emuserve
April 12th, 2001, 09:16
I have this myspace downloader cgi from ericscgi.com that can let my users directly download my files. Anyway I am having trouble setting it up. Whenever I upload it and chmod I always get an error. Can someone please help me? Here is the code of the cgi:
#!/usr/bin/perl

############################################################ ####
# #
# Erics CGI World - http://www.EricsCGI.com #
# MySpace.com Direct Download V1.1 #
# #
# Usage: /myspace.cgi/FolderID/FileID/SharePass/Filename.zip #
# #
# Installation Instructions: #
# Upload both files to your cgi-bin #
# CHMOD myspace.cgi to 755 #
# CHMOD lastknownmyspace.id to 777 #
# #
############################################################ ####

$username = "put username here";
# Create a myspace account to be used to access shared accounts
# Enter the username here

$password = "put password here";
# Enter the password for the username above

############################################################ ####
# No more editing required below this line #
# YOU MAY NOT DISTRIBUTE THIS SCRIPT UNDER ANY CIRCUMSTANCES #
############################################################ ####

use LWP::Simple;

($crap1,$folderid,$fileid,$sharepassword,$filename) = split(/\//,$ENV{'PATH_INFO'});

open (DATA,"./lastknownmyspace.id");
$somedata=<DATA>;
close (DATA);

if ($somedata ne ""){
($lnsessionid,$lnfolderid) = split(/\|/,$somedata);
$logout = "http://www.myspace.com/FoldersShare.asp?btn_logout=operation&folder_id=$lnfolderid&share_id=$lnsessionid";
$crap = get($logout);
}

$url = "http://www.myspace.com/FoldersShare.asp?folder_id=$folderid\&is_registered=no&f_username=$username\&f_userpwd=$password\&f_folderpwd=$sharepassword\&btn_enter=Enter";
$html = get($url);

($data1,$data2) = split(/SHPW/,$html);

if ($html ne "$data1$data2"){
($sessionid,$crapdata) = split(/\//,$data2);
}

if ($sessionid ne ""){
open (DATA,">./lastknownmyspace.id");
print DATA qq~$sessionid|$folderid~;
close (DATA);
`chmod 777 ./lastknownmyspace.id`;
}

if ($sessionid eq ""){
($test1,$test2) = split(/Do you wish to terminate the previous connection/,$html);

if ($html ne "$test1$test2"){
print "Content-type: text/html\n\n";

print qq~<html>

<head>
<title>ERROR</title>
</head>

<body bgcolor="#ffffff" text="#000000" id=all>

<p align="center"><font face="Arial" size="6">ERROR</font></p>
<p align="center"><font face="Arial" size="6">Username Already Logged in</font></p>
<p><font face="Arial">The owner of this account is currently logged in with a
browser<br>
Please DO NOT log in with your browser to the account being used by this script<br>
This script can log itself out but it needs the session id, folder id to do this<br>
Since this script did not log in it cannot log out!</font></p>
<p><font face="Arial">There is 3 things you can do</font></p>
<p><font face="Arial">1. Notify the owner of this site to logout<br>
2. Wait a few hours for it to timeout and try again<br>
3. Get an account at <a href="http://www.myspace.com" target="_blank">www.myspace.com</a>
then use it to login <a href="http://www.myspace.com/FoldersShare.asp?folder_id=$folderid&password=" target="_blank">HERE</a>
the shared password is: $sharepassword</font></p>

</body>

</html>~;
}
}

$url = "http://208.39.14.148/Files/$folderid\-$fileid\-SHPW$sessionid/$filename";

if ($sessionid eq ""){
print "Location: http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}\n\n";
exit;
}

print "Location: $url\n\n";

akersche
April 20th, 2001, 05:54
did you upload in Acsii- Mode? That's important.

And it seems you should have 2 files.

You also have to cusomize some stuff...
like username and password. bet you did that anyway.

And you perhaps need to change the perl path, to the proper one.

And I guess the error could be with myspace. The got that much load recently... that it's often not possible to conect to them and/or download from them.
And myspace could have changed the way the handle their sytem....


Greetings Arno

iwod
April 21st, 2001, 17:25
what about posting this question to the ericscgi.com fourms??

emuserve
April 21st, 2001, 17:43
I did but no one ever replied