TheOnlyOne Posted May 27, 2015 Posted May 27, 2015 (edited) Hi. I am trying to create an embedded ie window and have successfully done so. First I change the site to google.com (need to navigate before i can write html to the embedded window) Then i use _IEDocWriteHTML to make an embedded youtube link. The problem is I get an error when trying to play the song -> this video contains content from vevo. it is restricted from playback on certain sitesSo I tried googling this and it seems like I need to specify a Referer or youtube will block me(on certain videos)I once again turned to google and found this thread https://www.autoitscript.com/forum/topic/165108-ie-referrer/ and this snippet of code $oIE.Navigate2("http://whatismyreferer.com", Default, Default, Default, 'Referer: "newwebsite.com"')but I am not quite sure what I should fill in here. I have never heard of referer before this problem occoured, but isn't it what tells youtube where the user watching the video came from? how can i specify this when it is just a script running?this is the code i use to build the html i use to create the embedded link to youtubelocal $buildHtml = "" $buildHtml &= "<head>" & @CRLF $buildHtml &= "<body>" & @CRLF $buildHtml &= '<iframe width="300" height="300" src="https://www.youtube.com/embed/'& $split[1] &'?rel=0&showinfo=1" frameborder="0" allowfullscreen></iframe>' $buildHtml &= "</body>" & @CRLF $buildHtml &= "</head>" & @CRLFsplit[1] contains the id of the video. I would like some help to how I can resolve this and maybe an answer to if my understanding of a referer is correct(and/or maybe a more in depth answer)? Edited May 28, 2015 by TheOnlyOne
TheOnlyOne Posted May 28, 2015 Author Posted May 28, 2015 bump(I know it hasn't been 24 hours but I thought it was ok since there was all this spam yesterday and my post pretty much got buried )
Danp2 Posted May 28, 2015 Posted May 28, 2015 Can you post a short "reproducer" script that demonstrates the issue? Latest Webdriver UDF Release Webdriver Wiki FAQs
TheOnlyOne Posted May 28, 2015 Author Posted May 28, 2015 uhm yea, pretty much like this#include <ie.au3> $buildHtml = "" $buildHtml &= "<HTML>" & @CRLF $buildHtml &= "<BODY>" & @CRLF $buildHtml &= '<iframe width="560" height="315" src="https://www.youtube.com/embed/QcIy9NiNbmo?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>' & @CRLF $buildHtml &= "</BODY>" & @CRLF $buildHtml &= "</HTML>" $gui = GUICreate("",300,300,-1,-1) $ie = _IECreateEmbedded() GUICtrlCreateObj($ie,0,0,200,200) GUISetState(@SW_SHOW) _IENavigate($ie,"google.com",1) sleep(200) _IEDocWriteHTML($ie,$buildHtml) _IEAction($ie, "refresh") while(1) sleep(5) WEnd
TheOnlyOne Posted May 28, 2015 Author Posted May 28, 2015 Nvm I found a solution. By chaning the _ienavigate to youtube.com it will allow me to see the embedded video.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now