userscloud: fix
This commit is contained in:
@@ -19,18 +19,18 @@ def test_video_exists(page_url):
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("url=" + page_url)
|
||||
|
||||
video_urls = []
|
||||
unpacked = ""
|
||||
data = httptools.downloadpage(page_url).data
|
||||
packed = scrapertools.find_single_match(data, "function\(p,a,c,k.*?</script>")
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
if packed:
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
media_url = scrapertools.find_single_match(unpacked, 'src"value="([^"]+)')
|
||||
if not media_url:
|
||||
id_ = page_url.rsplit("/", 1)[1]
|
||||
rand = scrapertools.find_single_match(data, 'name="rand" value="([^"]+)"')
|
||||
post = "op=download2&id=%s&rand=%s&referer=%s&method_free=&method_premium=" % (id_, rand, page_url)
|
||||
data = httptools.downloadpage(page_url, post).data
|
||||
|
||||
media_url = scrapertools.find_single_match(data, '<div id="dl_link".*?<a href="([^"]+)"')
|
||||
|
||||
ext = scrapertools.get_filename_from_url(media_url)[-4:]
|
||||
|
||||
Reference in New Issue
Block a user