- stacked - 2009-09-05
why cant you just do something like
Code: http://video.google.com/googleplayer.swf?docid=(.+?)&hl=en&fs=true
- sansat - 2009-09-05
still its giving me []
Code: import urllib2,urllib,re
url='http://www.filmicity.in/videos.php?id=4684'
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()
print url
google=re.compile('http://video.google.com/googleplayer.swf?docId=(.+?)&hl=en&fs=true').findall(link)
print google
#addLink('Play '+name,url,"")
Can I split the ID from the output -
Code: http://video.google.com/googleplayer.swf?docId=2197268320520526787 - ?
- sansat - 2009-09-05
Ok I have found the acutal source for video which is
Code: http://v10.lscache3.googlevideo.com/videoplayback?id=7ffb40f883c63b49&itag=5&begin=0&ip=0.0.0.0&ipbits=0&expire=1252183696&sparams=ip,ipbits,expire,id,itag&signature=5843A4D2F0C86C5A0EC8777C0DF26093D96D5B4C.36E4922E9F3C48BF80035EA2290E6701C08554D1&key=ck1
Only let me know how I can get the id from below code..
Code: import urllib2,urllib,re
url='http://www.filmicity.in/videos.php?id=4684'
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()
print url
google=re.compile('http://video.google.com/googleplayer.swf?docId=(.+?)&hl=en&fs=true').findall(link)
print google
#addLink('Play '+name,url,"")
- stacked - 2009-09-05
u forgot to escape the special characters
- sansat - 2009-09-06
ok got it
thanks
- sansat - 2009-09-06
Can you please tell me if I have missed any special characters as I am getting [] for actual source
link - Code: http://video.google.com/videoplay?docid=2197268320520526787#
actual video section from above link source
Code: preview_url:'/s/zizJPyf32zs/googleplayer.swf?videoUrl\x3dhttp://v10.lscache3.googlevideo.com/videoplayback%3Fid%3D7ffb40f883c63b49%26itag%3D5%26begin%3D0%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1252256008%26sparams%3Dip,ipbits,expire,id,itag%26signature%3D42F54851C1453EFFFDBD8FA330BF4AB224D95960.250A203C393A8EFF44B63CD8EFDCEA353ED318F3%26key%3Dck1\x26thumbnailUrl\x3dhttp://1.gvt0.com/ThumbnailServer2%3Fapp%3Dvss%26contentid%3D7ffb40f883c63b49%26offsetms%3D5000%26itag%3Dw320%26hl%3Den%26sigh%3DN0YlP6Eyv09H8rlnaB_dbPcY_r8\x26docid\x3d2197268320520526787\x26hl\x3den\x26autoplay\x3d1',
Code where help is needed in special characters
Code: match=re.compile('preview_url\:\'/s/zizJPyf32zs/googleplayer\.swf\?videoUrl\x3d(.+?)\x26thumbnailUrl').findall(response)
full test code..
Code: import urllib2,urllib,re
url='http://www.filmicity.in/videos.php?id=4684'
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()
print url
google=re.compile('src=\"http://video\.google\.com/googleplayer\.swf\?docId=(.+?)"').findall(link)
print google[0]
req = urllib2.Request("http://video.google.com/videoplay?docid="+str(google[0]))
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')
response = urllib2.urlopen(req).read()
match=re.compile('preview_url\:\'/s/zizJPyf32zs/googleplayer\.swf\?videoUrl\x3d(.+?)\x26thumbnailUrl').findall(response)
print match
#addLink('Play '+name,"http://www.dailymotion.com"+urllib.unquote(match[0]),"")
#test = urllib.unquote('http://v10.lscache3.googlevideo.com/videoplayback%3Fid%3D7ffb40f883c63b49%26itag%3D5%26begin%3D0%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1252217864%26sparams%3Dip,ipbits,expire,id,itag%26signature%3D380E7CA446507B0854EB6FA1F63867604A02BD.8626274EC12894C27FC4BA53DE3BE6B7B1B5CD96%26key%3Dck1')
#print test
final output needed
Code: http://v10.lscache3.googlevideo.com/videoplayback?id=7ffb40f883c63b49&itag=5&begin=0&ip=0.0.0.0&ipbits=0&expire=1252217864&sparams=ip,ipbits,expire,id,itag&signature=380E7CA446507B0854EB6FA1F63867604A02BD.8626274EC12894C27FC4BA53DE3BE6B7B1B5CD96&key=ck1
please let me knw
- sansat - 2009-09-07
Any idea on above issue ?
- sansat - 2009-09-08
Any suggestion - Stacked ?
- stacked - 2009-09-09
Code: match=re.compile('preview_url\:\'/s/zizJPyf32zs/googleplayer\.swf\?videoUrl\\\\x3d(.+?)\\\\x26thumbnailUrl').findall(response)
You forgot to escape the backslash
- sansat - 2009-09-09
maybe you are busy, anyway I am temporarily running google videos using the flashdownloader.org site, whenever you get a chance do let me know on the above issue of regex..
I have nearly finished writing another plugin for interval.in, but its a very small issue which I am not able to figure out from the log. The issue is only part 1 vidoes are getting displayed, when I do the test individually all parts are displayed but in videolink section, only part 1 get shown no other parts - when you get time please let me know what is wrong.
Full code
http://pastebin.com/f1f792568
Full log
http://pastebin.com/f7b05d450
Below are the sections in log which is confusing and I am not able to figure why its shows video of part 1 and not part 2 etc
Shows part 1 and print code and url...
Code: 12:28:18 T:3460 M:1289695232 NOTICE: Mode: 4
12:28:18 T:3460 M:1289695232 NOTICE: URL: http://www.interval.in/videos.php?id=88295
12:28:18 T:3460 M:1289695232 NOTICE: Name: Part 1
12:28:18 T:3460 M:1289695232 NOTICE: http://www.interval.in/videos.php?id=88295
12:28:18 T:3460 M:1289666560 DEBUG: LoadLibraryA('ws2_32')
12:28:18 T:3460 M:1289666560 DEBUG: LoadLibrary('ws2_32.dll') returning: 038FCF50
12:28:19 T:3460 M:1289744384 NOTICE: code=uhVZyzQihnA
12:28:19 T:1644 M:1289867264 INFO: Loading skin file: DialogProgress.xml
12:28:19 T:1644 M:1289863168 DEBUG: Load DialogProgress.xml: 2.82ms
12:28:19 T:1644 M:1289863168 DEBUG: ------ Window Init (DialogProgress.xml) ------
12:28:19 T:1644 M:1289818112 DEBUG: Alloc resources: 1.06ms (0.00 ms skin load)
12:28:19 T:3460 M:1285652480 NOTICE: http://www.youtube.com/get_video?video_id=uhVZyzQihnA&t=vjVQa1PpcFOfju-K-nKkgsREnfdpz5B2kJ-UsnVbfCA%3D&fmt=18
12:28:19 T:3460 M:1287843840 INFO: Scriptresult: Success
12:28:20 T:1644 M:1287835648 DEBUG: DIRECTORY::CPluginDirectory::WaitOnScriptResult- plugin returned successfully
12:28:20 T:1644 M:1287831552 DEBUG: Saving fileitems [plugin://video/Interval/?url=http%3A%2F%2Fwww.interval.in%2Fvideos.php%3Fid%3D88295&mode=4&name=Part+1]
12:28:20 T:1644 M:1287831552 DEBUG: -- items: 1, sort method: 0, ascending: false
12:28:20 T:1260 M:1287716864 DEBUG: thread start, auto delete: 0
12:28:20 T:1260 M:1286967296 DEBUG: Thread 1260 terminating
12:28:20 T:3460 M:1286602752 INFO: Python script stopped
12:28:20 T:3460 M:1286602752 DEBUG: Thread 3460 terminating
12:28:20 T:1644 M:1286647808 DEBUG: ------ Window Deinit (DialogProgress.xml) ------
12:28:20 T:1644 M:1288818688 DEBUG: python thread 6 destructed
12:28:20 T:1644 M:1288818688 INFO: Python, unloading python24.dll because no scripts are running anymore
12:28:20 T:1644 M:1288855552 DEBUG: XBPython::UnloadExtensionLibs, clearing python extension libraries
12:28:20 T:1644 M:1288855552 DEBUG: Win32DllLoader::Unload DLLs\zlib.pyd
12:28:20 T:1644 M:1288855552 DEBUG: FreeLibrary(python24.dll) -> 039EF458
12:28:20 T:1644 M:1288855552 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:20 T:1644 M:1288916992 DEBUG: Win32DllLoader::Unload DLLs\_socket.pyd
12:28:20 T:1644 M:1288916992 DEBUG: FreeLibrary(python24.dll) -> 039EF458
12:28:20 T:1644 M:1288916992 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:20 T:1644 M:1288962048 DEBUG: Win32DllLoader::Unload DLLs\_ssl.pyd
12:28:20 T:1644 M:1288962048 DEBUG: FreeLibrary(python24.dll) -> 039EF458
12:28:20 T:1644 M:1288962048 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:20 T:1644 M:1289379840 DEBUG: Win32DllLoader::Unload python24.dll
12:28:20 T:1644 M:1289379840 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:22 T:1644 M:1290366976 DEBUG: SDLKeyboard: scancode: 28, sym: 13, unicode: 13, modifier: 0
12:28:22 T:1644 M:1290366976 DEBUG: CApplication::OnKey: 61453 pressed, action is 7
12:28:22 T:1644 M:1290604544 DEBUG: CGUIMediaWindow::GetDirectory
Shows part 2 but does not print code nor url - hence it does not show play part 2..
Code: 12:28:25 T:1596 M:1286545408 NOTICE: Mode: 4
12:28:25 T:1596 M:1286545408 NOTICE: URL: http://www.filmicity.in/videos.php?id=88296
12:28:25 T:1596 M:1286545408 NOTICE: Name: Part 2
12:28:25 T:1596 M:1286545408 NOTICE: http://www.filmicity.in/videos.php?id=88296
12:28:25 T:1596 M:1286516736 DEBUG: LoadLibraryA('ws2_32')
12:28:25 T:1596 M:1286516736 DEBUG: LoadLibrary('ws2_32.dll') returning: 038FCF50
12:28:25 T:1596 M:1286410240 INFO: Scriptresult: Success
12:28:25 T:1644 M:1286410240 DEBUG: DIRECTORY::CPluginDirectory::WaitOnScriptResult- plugin returned successfully
12:28:25 T:2944 M:1286406144 DEBUG: thread start, auto delete: 0
12:28:26 T:2944 M:1286393856 DEBUG: Thread 2944 terminating
12:28:26 T:1596 M:1286434816 INFO: Python script stopped
12:28:26 T:1596 M:1286434816 DEBUG: Thread 1596 terminating
12:28:26 T:1644 M:1286479872 DEBUG: python thread 7 destructed
12:28:26 T:1644 M:1286479872 INFO: Python, unloading python24.dll because no scripts are running anymore
12:28:26 T:1644 M:1286479872 DEBUG: XBPython::UnloadExtensionLibs, clearing python extension libraries
12:28:26 T:1644 M:1286479872 DEBUG: Win32DllLoader::Unload DLLs\zlib.pyd
12:28:26 T:1644 M:1286479872 DEBUG: FreeLibrary(python24.dll) -> 0394D960
12:28:26 T:1644 M:1286479872 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:26 T:1644 M:1286541312 DEBUG: Win32DllLoader::Unload DLLs\_socket.pyd
12:28:26 T:1644 M:1286541312 DEBUG: FreeLibrary(python24.dll) -> 0394D960
12:28:26 T:1644 M:1286541312 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:26 T:1644 M:1286586368 DEBUG: Win32DllLoader::Unload DLLs\_ssl.pyd
12:28:26 T:1644 M:1286586368 DEBUG: FreeLibrary(python24.dll) -> 0394D960
12:28:26 T:1644 M:1286586368 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:26 T:1644 M:1287004160 DEBUG: Win32DllLoader::Unload python24.dll
12:28:26 T:1644 M:1287004160 DEBUG: FreeLibrary(MSVCR71.dll) -> 01779DE0
12:28:28 T:1644 M:1288048640 DEBUG: SDLKeyboard: scancode: 28, sym: 13, unicode: 13, modifier: 0
12:28:28 T:1644 M:1288048640 DEBUG: CApplication::OnKey: 61453 pressed, action is 7
12:28:28 T:1644 M:1288060928 DEBUG: CGUIMediaWindow::GetDirectory
It might be something silly but I am not able to figure out, please guide..
Thanks
- sansat - 2009-09-09
Thanks for replying to the regex query.
Is x3d considered special character and then we need to put 3 backslashes as there are 3 letters ? is that how it works for special characters?
When you get time, please let me know your view on the above issue on part 2, 3 etc not being displayed in videos section ..
Thanks
- stacked - 2009-09-09
sansat Wrote:Thanks for replying to the regex query.
Is x3d considered special character and then we need to put 3 backslashes as there are 3 letters ? is that how it works for special characters?
When you get time, please let me know your view on the above issue on part 2, 3 etc not being displayed in videos section ..
Thanks
the html source had two backslash \\, so to escape it, you need to add two more backslash resulting in \\\\
I started school and I'm either too busy or too tired to do anything. I would rather not waste more time this site/plugin. I'll try to answer any quick syntax/python questions but I'm not going through the full code to fix problems. Sorry Good luck with it.
- sansat - 2009-09-09
Thanks for replying.
I understand once school starts then we get busy.
Anyway I think I figured out the issue.
Thanks for all your help
|