Open Media Library Platform
This commit is contained in:
commit
411ad5b16f
5849 changed files with 1778641 additions and 0 deletions
17
Shared/lib/python2.7/site-packages/ox/web/piratecinema.py
Normal file
17
Shared/lib/python2.7/site-packages/ox/web/piratecinema.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
import re
|
||||
from ox.net import read_url
|
||||
|
||||
def get_poster_url(id):
|
||||
url = 'http://piratecinema.org/posters/'
|
||||
html = read_url(url, unicode=True)
|
||||
results = re.compile('src="(.+)" title=".+\((\d{7})\)"').findall(html)
|
||||
for result in results:
|
||||
if result[1] == id:
|
||||
return url + result[0]
|
||||
return ''
|
||||
|
||||
if __name__ == '__main__':
|
||||
print get_poster_url('0749451')
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue