2009-08-30, 20:49
sansat Wrote:Thanks Stacked, actually I was looking at only the first regex and it was matching in both working and non working videos, did not look into the second one, do we need the second one ? for any videos as I am not downloading the video's so maybe I will remove it and see if it helps.
The second regex uses flashvideodownloader.org to extract the direct video url (*.flv) from the dailymotion site. So you do need it.
Quote:Thanks for your guidance and also regarding multiple urls, my requirement was to first scrape a url, if it does not return a value, then scrape the second url, so when I add the below code for each url it does not work so was not sure if we could scrape many url in one definition(for example in def PARTS(url) using below code twice,
Code:req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
thanks for your guidance and tips as it really directs me in the right direction..As you said this site is very inconsistent but since its the first site i am trying so if I try various scenarios it will help me in creating other plugins faster - hopefully
The code below checks for matches in part 1 and then part 2
http://pastebin.com/m6119b0ae
...I really hope your plugin is done because I don't feel like writing any more code