Menu

[f7b098]: / nosvideo.py  Maximize  Restore  History

Download this file

38 lines (27 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
def parse(URL, debug=False):
from time import sleep
from htmlparser import between, Eval
from httpclient import HttpClient
r = HttpClient(debug=debug)
r.GET(URL)
filename = between(r.Page, '<font id="fname1">', '</font>')
# Continue to Video
caption = between(r.Page, '<input type="submit" value="', '"')
vars = r.Page.findForm(action='').POSTdict()
vars['method_free'] = caption
r.POST(URL, vars)
# from where is the playlist XML loaded ?
script = Eval(between(r.Page, "src='http://nosvideo.com/player/swfobject.js'></script><script type='text/javascript'>", "</script>").strip()).deobfuscate().replace("\\'", "'")
#print script
playlistURL = between(script, "playlist=", ".xml")+".xml"
#print playlistURL
# download playlist and extract video URL
r.GET(playlistURL)
#print str(r.Page)
url = between(r.Page, "<file>", "</file>").strip()
return {'directlink': url, 'filename': filename}
if __name__ == "__main__":
from sys import argv
print str( parse(argv[1]) )