Jump to content

Recommended Posts

Posted

Hi guys,

Would just like to check. I am going to do a File upload script to a file sharing service where I can queue the files and let it auto upload.

But I face a problem where how can I let the script detect that the upload is done? Can I use ie_loadwait ? as you know when uploading usually there is a progress bar.

What command can be used?

Posted

I am uploading to Megarotic. As the site is an adult site, please note before you go in.

I have checked and the URL still remains the same during and after uploading:

http://www.megarotic.com/video/?c=upload

Below is the source of the page. Does anyone know how I can do it? Some files are bigger than others so they need a longer time to upload. How can I ensure that it will only start the next upload upon the first one finishing?

Thank you for any help provided.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>


<link rel="icon" href="http://video.megarotic.com/mr_icon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://video.megarotic.com/mr_icon.ico" type="image/x-icon">

<HEAD>
<TITLE> Megarotic Video</TITLE>
</HEAD>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<script type="text/javascript" src="flashobject2.js"></script>

<link href="mrstyles.css" rel="stylesheet" type="text/css">


<style type="text/css">
body 
{
    text-align:center;
    padding:0; margin:0;
    background-image:url(gui/bg.gif);
    font-family: tahoma;
    font-size: 11px;
    text-align: left;
}


#main 
{
    width:997px;
    position: relative;
    margin-top:0px;
    text-align:center;
}
#mv1
{
  position:absolute;
  top:3px; left:0px;
  width:979px; height:204px;
}
#mv2
{
  position:absolute;
  top:108px; left:1px;
  width:977px; height:56px;
  background-image:url('gui/shadow.gif');
}

a
{
  font-family:tahoma;
}

#mainpage
{
  position:absolute;
  top:115px; left:1px;
  width:977px;
  text-align:left;
}

.button
{
    border: 1px solid #327AA3;
    background-color: #EFF2F5;
}

</style>


<BODY>


<script type="text/javascript">
function logout()
{
  document.getElementById('logoutform').submit();
}


document.domain = 'megarotic.com';

</script>


<center>
<div style="position:absolute; display:none;">
<form method="post" id="logoutform" action="?">

<input type="hidden" name="logout" value="1">
</form>
</div>

<div id="main">

<div id="mv1">
<script type="text/javascript">
    var fo = new FlashObject("gui/top.swf", "", "979", "104", 7, "#ffffff");
    fo.addParam("wmode", "transparent");
    fo.addParam("menu", "false");
    fo.addVariable("play4", "1");
    fo.addVariable("b_video","Videos");
    fo.addVariable("b_categ","Categories");
    fo.addVariable("b_rewards","Rewards");
    fo.addVariable("b_premium","Premium");
            fo.addVariable("loggedin","1");
    fo.addVariable("nickname","tradertt");
    fo.addVariable("messages","0");
        
    fo.addVariable("my_my","My:");
    fo.addVariable("my_videos","Videos");
    fo.addVariable("my_favorites","Favorites");
    fo.addVariable("my_inbox","Inbox");
    fo.addVariable("my_subscriptions","Subscriptions");
    fo.addVariable("my_friends","Friends");

    fo.addVariable("producer","Producers Deal");

    fo.addVariable("searchtext","Search for videos");

    fo.write();
</script>
</div>
<div id="mv2"></div>



<div id="mainpage">


<script language="javascript">
 document.domain = 'megarotic.com';
</script>





<img src="gui/spacer.gif" width="1" height="10">









<TABLE cellpadding="0" cellspacing="0">
<TR>
    <TD width="5"></TD>
    <TD>
    

    <div style="position:relative;">
    <div style="position:relative; height:28px;"></div>

    <div style="position:absolute; left:0px; top:-13px; width:10px; height:80px; background-image:url('gui/tab_top_l.gif');"></div>
    <div style="position:absolute; left:10px; top:-13px; width:949px; height:80px; background-image:url('gui/tab_top_mid.gif');"></div>

    <div style="position:absolute; left:959px; top:-13px; width:10px; height:80px; background-image:url('gui/tab_top_r.gif');"></div>

    <div style="position:absolute; left:0px; top:-4px; width:960px; text-align:center; color:#00000; font-weight:bold; font-size:12px;">Video Upload (Step 2 of 2)</div>

    


    <div style="position:relative;">

    <TABLE background="gui/tab_mid.gif" cellpadding="0" cellspacing="0" width="969" style="font-size:11px; color:#4C4C4C;">
    <form  method="post" target="progressframe" value="" action="http://www40.megarotic.com/up.php?UPLOAD_IDENTIFIER=8779871200380228" id="progressfrm"></form>
    <TR> 
        <td width="10"></td>

        <TD width="960" height="350" valign="middle" align="center">

        <div id="uploadfields" style="">
        <TABLE cellpadding="0" cellspacing="0" style="font-size:11px;">
        <form method="post" enctype="multipart/form-data" action="http://www40.megarotic.com/upload_video.php?UPLOAD_IDENTIFIER=8779871200380228"  id="uploadfrm" target="uploadframe">
        <input type="hidden" name="action" value="submit">
        <input type="hidden" name="tags" value="Japan girl downblouse">
        <input type="hidden" name="title" value="Japan Girl Downblouse">
        <input type="hidden" name="language" value="1">

        <input type="hidden" name="message" value="Japan girl downblouse">
        <input type="hidden" name="channels" value="122;133;71;">
        
                <TR>
            <td width="50"></td>
            <TD style="color:#327AA3; text-align:right; padding-top:4px;" width="100"  valign="top">File:</TD>
            <td width="5"></td>
            <TD height="40" valign="top">
            <input type="file" name="file" size="65" style="border: 1px solid #327AA3; background-color: #FBFAF7; width:437px;"  style="width:500px;">

            </TD>
        </TR>
        <TR>
            <TD colspan="3"></TD>
            <TD>
            <div style="position:relative; width:420px;">
            <strong>Max file size: 5 GB. No copyrighted material.</strong>
            <br>After uploading, you can edit or remove this video at any time under the "My Videos" link at the top of the page.
            </div>

            </TD>
        </TR>
        <tr>
        <TD></TD>
        <td colspan="3" height="40" valign="top">               
        <div style="position:relative; border-bottom:1px dashed #C2B594; width:700px; height:22px;"></div>      
        </td>
        </tr>
        <TR>
            <TD></TD>

            <TD style="color:#327AA3; text-align:right; padding-top:4px;" width="100"  valign="top">Broadcast:</TD>
            <TD></TD>
            <TD style="line-height:25px;" valign="top">

            <input type="radio" name="private" checked value="0"> <b>Public:</b> &nbsp;Share your video with the world! (Recommended)<br>
            <input type="radio" name="private" value="1"> <b>Private:</b> &nbsp; Only viewable by you and those you give the video link to! (Will not be listed on our site)<br>

            
                        
            </TD>
        </TR>
        <tr>
        <TD></TD>
        <td colspan="3" height="40" valign="top">               
        <div style="position:relative; border-bottom:1px dashed #C2B594; width:700px; height:22px;"></div>      
        </td>
        </tr>
        <TR>
        <TD colspan="4" align="center">

        

        <script type="text/javascript">
            var fo = new FlashObject("buttons/upload.swf", "", "163", "33", 7, "");
            fo.addParam("wmode", "transparent");
            fo.addVariable("bmrv_upload","Upload");
            fo.write();

            function postupload()
            {
              document.getElementById('uploadfrm').submit();
              document.getElementById('progressfrm').submit();
                document.getElementById('uploadfields').style.display='none';
                document.getElementById('uploadprogress').style.display='';

            }
        </script>

        <br><br><br>
        <div style="color:#327AA3; font-weight:bold; font-size:11px;">
        PLEASE BE PATIENT, THIS MAY TAKE SEVERAL MINUTES.<br>
        ONCE COMPLETED, YOU WILL SEE A CONFIRMATION MESSAGE.
        </div>

        </TD>

        </TR>

        </form>
        </TABLE>
        </div>



        <div id="uploadprogress" style="display:none;">

        <div style="position:absolute; left:20px; width:917px; height:340px; top:0px; background-image:url('gui/progress.gif');"></div>

        
        <div style="position:absolute; top:-6px; left:210px;">
        <script type="text/javascript">
        var fo = new FlashObject("gui/mrv_pogress.swf", "progress_bar", "539", "263", 7, "#ffffff");
        fo.addParam("wmode", "transparent");
        fo.write();
        </script>
        </div>

        
        <div style="position:absolute; left:340px; top:254px;">
        <TABLE cellpadding="0">
        <TR>
            <TD style="color:#327AA3; font-weight:bold; font-family:tahoma; font-size:11px;" width="190">Estimated time left:</TD>

            <TD><div id="details1" style="color:#6C5F37;  font-family:tahoma; font-size:11px;">Unknown</div></TD>
        </TR>
        <TR>
            <TD style="color:#327AA3; font-weight:bold; font-family:tahoma; font-size:11px;" width="200">Elapsed time - Transfer rate:</TD>
            <TD><div id="details2" style="color:#6C5F37;  font-family:tahoma; font-size:11px;">Unknown</div></TD>
        </TR>
        </TABLE>

        </div>




        <div id="downloadurl" style="position:absolute; left:300px; top:300px; width:340px; display:none;">
        
        <div style="position:absolute; left:10px; top:0px;">
        <script type="text/javascript">
        var fo = new FlashObject("gui/ar_l.swf", "", "30", "10", 7, "#ffffff");
        fo.addParam("wmode", "transparent");
        fo.write();
        </script>
        </div>

        <div id="dlurl" style="position:absolute; left:30px; top:0px; width:295px; text-align:center; color:#000000; font-weight:bold;"></div>


        <div style="position:absolute; left:320px; top:0px;">
        <script type="text/javascript">
        var fo = new FlashObject("gui/ar_r.swf", "", "30", "10", 7, "#ffffff");
        fo.addParam("wmode", "transparent");
        fo.write();
        </script>
        </div>


    
        
        </div>
        
        

        </div>

            
        </TD>

    </TR>
    </TABLE>
    </div>


    <div style="position:relative; height:12px;">
    <div style="position:absolute; left:0px; top:0px; width:12px; height:12px;"><IMG SRC="gui/tab_catmain_l_bot.gif" WIDTH="12" HEIGHT="12" BORDER="0" ALT=""></div>
    <div style="position:absolute; left:12px; top:0px; width:945px; height:12px;"><TABLE cellpadding="0" cellspacing="0" background="gui/tab_catmain_mid_bot.gif" width="945" height="12"><TR><TD></TD></TR></TABLE></div>
    <div style="position:absolute; left:957px; top:0px; width:12px; height:12px;"><IMG SRC="gui/tab_catmain_r_bot.gif" WIDTH="12" HEIGHT="12" BORDER="0" ALT=""></div>
    </div>



    </div>
    </div>
    
    </TD>
</TR>
</TABLE>






<script type="text/javascript" language="Javascript1.2">
var uploading = false;
var percentage = 0;
var status = 'Initalizing upload';
var progress ='';
var time_elapsed = '00:00:00';
var speed = '0 KB/sec';
var downloadurl='';
var error='';
var trnsfrd='';

function getFlashMovieObject()
{
     return document.getElementById('progress_bar');
}

function SendDataToFlashMovie(per)
{
    var flashMovie=getFlashMovieObject();
    flashMovie.SetVariable("/:percentage", per);
}




var percentage = '0';
var progress = 'unknown';
var time_elapsed = 'unknown';
var speed = 'unknown';  
var status = 'Initiating download..';
var downloadurl = 'http://';
var multiuploads=false;
var multiresult = new Array();


function updateprogress()
{
     document.getElementById("details1").innerHTML = progress;
     document.getElementById("details2").innerHTML = time_elapsed + ' - ' + speed;
     SendDataToFlashMovie(percentage);
}

function uploaddone()
{
    uploading = false;
    document.getElementById('dlurl').innerHTML = '<a href="' + downloadurl + '" style="color:#000000; font-weight:bold;">' + downloadurl + '</a>';
    document.getElementById("details1").innerHTML = progress;
    document.getElementById("details2").innerHTML = time_elapsed + ' - ' + speed;
    document.getElementById("downloadurl").style.display = '';

    SendDataToFlashMovie(100);

}

function showresult()
{
//  uploaddone();
}

function showerror()
{
    alert(error);
}






</script>



<iframe src="" width="1" height="1" name="uploadframe" style="border:0px;"></iframe>
<iframe src="" width="1" height="1" name="progressframe" style="border:0px;"></iframe>






<div style="position:relative;">

<div style="position:relative; width:983px; height:85px; background-image:url('gui/bottom_menu_shadow.gif');">
<div style="position:absolute; top:15px; width:985px; text-align:center;">
<center>
<TABLE style="font-size:11px;">
<TR>
    <TD><a href="?c=terms" >terms of service</a></TD>
    <TD width="50" align="center">-</TD>
    <TD><a href="?c=privacy" >privacy policy</a></TD>
    <TD width="50" align="center">-</TD>

    <TD><a href="?c=dmca" >dmca policy</a></TD>
    <TD width="50" align="center">-</TD>
    <TD><a href="?c=abuse">report abuse</a></TD>
    <TD width="50" align="center">-</TD>
    <TD><a href="?c=contact">contact us</a></TD>
</TR>
</TABLE>

</center>
</div>
</div>
</div>
</div>




</div>
</center>




<iframe src="http://video.megarotic.com/et.php?r=http%3A%2F%2Fwww.megarotic.com%2Fvideo%2F%3Fc%3Dupload" width="1" height="1" name="uploadframe" style="border:0px;"></iframe>

<script type="text/javascript" language="javascript1.2"><!--
EXs=screen;EXw=EXs.width;navigator.appName!="Netscape"?
EXb=EXs.colorDepth:EXb=EXs.pixelDepth;//-->
</script><script type="text/javascript"><!--
navigator.javaEnabled()==1?EXjv="y":EXjv="n";
EXd=document;EXw?"":EXw="na";EXb?"":EXb="na";
EXd.write("<img src=\"http://nht-2.extreme-dm.com",
"/n2.g?login=kimble2&amp;pid=index&amp;",
"jv="+EXjv+"&amp;j=y&amp;srw="+EXw+"&amp;srb="+EXb+"&amp;",
"l="+escape(EXd.referrer)+"\" height=1 width=1>");//-->
</script><noscript><img height="1" width="1" alt=""
src="http://nht-2.extreme-dm.com/n2.g?login=kimble2&amp;pid=index&amp;j=n&am
p;jv=n"/>
</noscript>


</BODY>
</HTML>
Posted

Haha .. ok I am having problems to anyone that can help

#RequireAdmin
#include<IE.au3>
#include<File.au3>
#include<GUIConstants.au3>
#include<Array.au3>

$oIE=_IECreate("http://www.megarotic.com/video/?c=upload",0,1,1,-1)
            $PostEdit=_IEGetObjById($oIE,"title")           
            _IEFormElementSetValue($PostEdit,"postedit")
            $PostEdit1=_IEGetObjById($oIE,"description")            
            _IEFormElementSetValue($PostEdit1,"postedit1")
            $PostEdit2=_IEGetObjById($oIE,"tags")           
            _IEFormElementSetValue($PostEdit2,"postedit2")
            $PostEdit3=_IEGetObjById($oIE,"channel48")          
            _IEAction ($PostEdit3, "click")
Sleep(1000)
    $oForm = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm)
    _IELoadWait ($oIE)

            $PostEdit4=_IEGetObjById($oIE,"file")
            _IEFormElementSetValue($PostEdit4,"test")

I have done it up to here but

$postedit4 which is the place where I place the file to be uploaded

c:\movie.avi

I cannot seem to select its value. When I used debug toolbar, it appears that the name is correct "file" but it does not seem to input the value in.

Can anyone advice?

Posted

#RequireAdmin
#include<IE.au3>
#include<File.au3>
#include<GUIConstants.au3>
#include<Array.au3>
Opt("SendKeyDelay", 5) 
For $o=1 to 3
$oIE=_IECreate("http://www.megarotic.com/video/?c=upload",0,1,1,-1)
            $PostEdit=_IEGetObjById($oIE,"title")           
            _IEFormElementSetValue($PostEdit,"Room Service")
            $PostEdit1=_IEGetObjById($oIE,"description")            
            _IEFormElementSetValue($PostEdit1,"Room Service")
            $PostEdit2=_IEGetObjById($oIE,"tags")           
            _IEFormElementSetValue($PostEdit2,"Room Service")
            $PostEdit3=_IEGetObjById($oIE,"channel49")          
            _IEAction ($PostEdit3, "click")
Sleep(1000)
    $oForm = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm)
    _IELoadWait ($oIE)
Sleep(5000)
            $PostEdit4=_IEGetObjByName($oIE,"file")
_IEAction($PostEdit4, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "C:\Users\User\Documents\To Upload\Room_Service_61.3gp")

            $oForm1 = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm1) 
    _IELoadWait ($oIE)
    Next

Hi guys, have answered the question myself. However, still unable to solve the last portion. ieloadwait does not wait for the upload to finish before starting on a new upload. Is there any workaround to this problem?

Posted

#RequireAdmin
#include<IE.au3>
#include<File.au3>
#include<GUIConstants.au3>
#include<Array.au3>
Opt("SendKeyDelay", 50) 
For $o=1 to 3
$oIE=_IECreate("http://www.megarotic.com/video/?c=upload",0,1,1,-1)
            $PostEdit=_IEGetObjById($oIE,"title")           
            _IEFormElementSetValue($PostEdit,"Room Service")
            $PostEdit1=_IEGetObjById($oIE,"description")            
            _IEFormElementSetValue($PostEdit1,"Room Service")
            $PostEdit2=_IEGetObjById($oIE,"tags")           
            _IEFormElementSetValue($PostEdit2,"Room Service")
            $PostEdit3=_IEGetObjById($oIE,"channel49")          
            _IEAction ($PostEdit3, "click")
Sleep(1000)
    $oForm = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm)
    _IELoadWait ($oIE)
Sleep(5000)
            $PostEdit4=_IEGetObjByName($oIE,"file")
_IEAction($PostEdit4, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "C:\Users\User\Documents\To Upload\Room_Service_61.3gp")

            $oForm1 = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm1) 
    Sleep(1000)
    $sHTML = _IEDocReadHTML ($oIE)
    For $oi=1 to 60
If StringInStr($sHTML,'PLEASE BE PATIENT, THIS MAY TAKE SEVERAL MINUTES.') Then
 Sleep(5000)
EndIf
Next
    Next

Does this look correct to anyone?

Posted

I can see one obvious mistake. The $sHTML = _IEDocReadHTML ($oIE) line should be 1 line lower so it's inside the loop. No point testing a variable that is never changing.

Posted

#RequireAdmin
#include<IE.au3>
#include<File.au3>
#include<GUIConstants.au3>
#include<Array.au3>
Opt("SendKeyDelay", 1) 
$oIE=_IECreate("http://www.megarotic.com/video/?c=upload",0,1,1,-1)
            $PostEdit=_IEGetObjById($oIE,"title")           
            _IEFormElementSetValue($PostEdit,"Room Service")
            $PostEdit1=_IEGetObjById($oIE,"description")            
            _IEFormElementSetValue($PostEdit1,"Room Service")
            $PostEdit2=_IEGetObjById($oIE,"tags")           
            _IEFormElementSetValue($PostEdit2,"Room Service")
            $PostEdit3=_IEGetObjById($oIE,"channel49")          
            _IEAction ($PostEdit3, "click")
Sleep(1000)
    $oForm = _IEFormGetCollection ($oIE, 1)
    _IEFormSubmit ($oForm)
    _IELoadWait ($oIE)
Sleep(5000)
            $PostEdit4=_IEGetObjByName($oIE,"file")
_IEAction($PostEdit4, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
Sleep(1000)
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "C:\Users\test.avi")
Sleep(1000)
            $oForm1 = _IEGetObjByName ($oIE, "progressfrm")
    _IEFormSubmit ($oForm1) 
    Sleep(1000)


    ;$sHTML = _IEBodyReadText ($oIE)
;$stringcheck = StringRegExp($sHTML,"PLEASE BE PATIENT")
;Do
;   $i = $stringcheck
;Until $i = 0
        
;MsgBox(0, "Value of $i is:", $i)

$oForm1 = _IEGetObjByName ($oIE, "progressfrm")

_IEFormSubmit ($oForm1)

Can anyone please help. Cannot seem to click on the form ......

Posted

<script type=text/javascript>
            var fo = new FlashObject("buttons/upload.swf", "", "163", "33", 7, "");
            fo.addParam("wmode", "transparent");
            fo.addVariable("bmrv_upload","Upload");
            fo.write();

            function postupload()
            {
              document.getElementById('uploadfrm').submit();
              document.getElementById('progressfrm').submit();
                document.getElementById('uploadfields').style.display='none';
                document.getElementById('uploadprogress').style.display='';

            }
        </SCRIPT>

This is one script I found with deBug toolbar... not too sure if anything can be used from there

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...