Sign in to follow this  
Followers 0
AzKay

Youtube...Uploader

12 posts in this topic

Okay, im making a utube uploader, based using IE, First of all, anyone know another way? without using IE functions? 2nd, im having trouble...

#include <GUIConstants.au3>
#include <IE.au3>
#NoTrayIcon
Opt("GUIOnEventMode", 1)
### Koda GUI section start ###
$YouTubeUpload = GUICreate("YouTubeUpload", 284, 220, 190, 117)
$UserName = GUICtrlCreateInput("Username", 0, 0, 281, 21)
$oIE = ObjCreate("Shell.Explorer.2")
$oIE_ctrl = GUICtrlCreateObj($oIE, 0, 176, 74, 92)
GUICtrlSetState(-1, $GUI_HIDE)
$PassWord = GUICtrlCreateInput("Password", 0, 24, 281, 21)
$Title = GUICtrlCreateInput("Title", 0, 48, 281, 21)
$Description = GUICtrlCreateInput("Description", 0, 72, 281, 21)
$Tags = GUICtrlCreateInput("Tags", 0, 96, 281, 21)
$Private = GUICtrlCreateRadio("Private", 80, 152, 65, 17)
$Public = GUICtrlCreateRadio("Public", 8, 152, 65, 17)
$File = GUICtrlCreateInput("File", 0, 120, 281, 21)
$Upload = GUICtrlCreateButton("Upload", 152, 144, 129, 33, 0)
GUICtrlSetOnEvent(-1, "UploadClick")
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$Load = GUICtrlCreateLabel("...", 112, 190, 61, 17, $SS_CENTER)
GUISetState(@SW_SHOW)
### Koda GUI section end   ###

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
    Sleep(100)
WEnd

Func UploadClick()
GUICtrlSetData($Load, "Uploading")
GUICtrlSetState($Upload, $GUI_DISABLE)
$Test_IE = _IECreate("http://youtube.com/login")
;_IENavigate($oIE, "http://youtube.com/login")
$oLoginForm = _IEFormGetObjByName ($Test_IE, "loginForm")
$oUsername = _IEFormElementGetObjByName ($oLoginForm, "username")
$oPassword = _IEFormElementGetObjByName ($oLoginForm, "password")
_IEFormElementSetValue ($oUsername, GUICtrlRead($UserName))
_IEFormElementSetValue ($oPassword, GUICtrlRead($PassWord))
$oLogin = _IEGetObjByName ($Test_IE, "action_login")
_IEAction ($oLogin, "click")
_IELoadWait($Test_IE)
_IENavigate($Test_IE, "http://youtube.com/my_videos_upload")
$oUploadForm1 = _IEFormGetObjByName ($Test_IE, "") ;What would be the form name? I cant find one...
$oTitle = _IEFormElementGetObjByName ($oUploadForm1, "field_myvideo_title")
_IEFormElementSetValue ($oTitle, GUICtrlRead($Title))
EndFunc

Func Quit()
    Exit
EndFunc

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites



What's the point? Why can't you just open a browser and upload?

Share this post


Link to post
Share on other sites

What's the point? Why can't you just open a browser and upload?

Well, this "IE" page wont show, its just opening one atm so I know whats happening, and its easier to just fill out a couple of box's and press upload

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

If there is no form name, then use _IEFormGetCollection($oIE, $index) and get the form reference using a zero-based index instead of a name.

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

--> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

I used the example in the helpfile, changing the site url

Edited by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Using the most current version of IE.au3?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Yes


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

--> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

I used the example in the helpfile, changing the site url

There are 2 examples for that function. Did they work for you as written? You'll need to figure out how to adapt them to your page by doing more than changing the URL. You mught also want to show your code.

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

Share this post


Link to post
Share on other sites

Well I tryed the 2nd example, that one worked, liek, "standalone" the otherone didnt. I didnt test it actually with my code, I tested it by iteself


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Well I tryed the 2nd example, that one worked, liek, "standalone" the otherone didnt. I didnt test it actually with my code, I tested it by iteself

Both examples work fine for me as written. You say the first one "didnt" for you? How did it fail?

Sorry, if you want help you're going to have to make it easier to help you. There is nothing I can do with what you've provided so far.

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

Share this post


Link to post
Share on other sites

Both examples work fine for me as written. You say the first one "didnt" for you? How did it fail?

Sorry, if you want help you're going to have to make it easier to help you. There is nothing I can do with what you've provided so far.

Dale

Well, I dont know how it failed ><

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Well, I dont know how it failed ><

Then I don't know how to help you.

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0