Jump to content

Grabbing file name from _iecreate - google flv video


Recommended Posts

Having some difficulty capturing a file name from a _IECreate call.

I'm going out to a site, finding a particular file and am attempting to download it - a dialog pops up and i'm allowed to save the file but i want to know the file name chosen because I'd like to have it for further processing.

#include <ie.au3>

$IEO = _iecreate ("http://video.google.com/videoplay?docid=-6358824457869316582",0,0)
            
$var_player = _IEGetObjByName($IEO,"VideoPlayback")
    
$t = $var_player.src

;do some string replacement
;there's probably an easier way to do this...
$t = StringReplace($t, "%22",'"')
$t = StringReplace($t,"%27", '"')
$t = StringReplace($t, "%28","(")
$t = StringReplace($t, "%29",")")
$t = StringReplace($t, "%40","@")
$t = StringReplace($t, "%20"," ")
$t = StringReplace($t, "%3F","?" )
$t = StringReplace($t, "%3D","=")
$t = StringReplace($t, "%26","&")
$t = StringReplace($t, "%3A",":")
$t = StringReplace($t, "%2F","/")

$t = StringReplace($t, "/googleplayer.swf?&videoUrl=","")
$t = StringReplace($t, "&messagesUrl=http://video.google.com/FlashUiStrings.xlb?frame=flashstrings&hl=en&autoPlay=true","")

$ieo2 = _IECreate ($t,0,0,1,-1)
        
_IEQuit($IEO)
_iequit($ieo2)

Any assistance on capturing the file name would be appreciated.

Link to comment
Share on other sites

Where do you see the filename in the source?

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Here's the easier way to unencode your string:

$t = $IEO.document.parentwindow.eval('unescape("' & $t & '")')

I don't know what you mean by

google responds with a file

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks for the unescape hint. i looked all over for something like that.

Regarding the response with the file - if i cut and paste the url from $t in to a browser and watch the tcpip stream, google starts streaming back the flv file after a response code of 200. I'm not sure how better to explain... it's like, rather than getting html back you get the binary data. IE interprets that as a file and prompts you to save it.

I'm glad to try another approach - just haven't found a good way.

Link to comment
Share on other sites

Thanks for the unescape hint. i looked all over for something like that.

Regarding the response with the file - if i cut and paste the url from $t in to a browser and watch the tcpip stream, google starts streaming back the flv file after a response code of 200. I'm not sure how better to explain... it's like, rather than getting html back you get the binary data. IE interprets that as a file and prompts you to save it.

I'm glad to try another approach - just haven't found a good way.

Wondering if anyone has had an opportunity to check this out further.

I've tried ieloadwait and inetget but it's just not working.

Link to comment
Share on other sites

Wondering if anyone has had an opportunity to check this out further.

I've tried ieloadwait and inetget but it's just not working.

in my attempt to debug - i've gone through ie.au3 and see that the process stops at

_IENavigate($o_object, $s_Url, $f_wait)

in _iecreate()

it looks like ie grabs the url that i pass and then somehow creates a new handle the autoit doesn't "know" about. i get prompted for a file save as dialog box but autoit continues to wait and wait until a time out.

strange. I wish I could capture this.

Link to comment
Share on other sites

Can you provide a reproducer?

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

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