mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
add support for mtv81
This commit is contained in:
parent
e286d91a09
commit
1dd76593ff
@ -6,28 +6,33 @@ from ..common import *
|
||||
from html.parser import unescape
|
||||
from xml.dom.minidom import parseString
|
||||
|
||||
def mtv81_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
html=get_content(url)
|
||||
title=unescape("|".join(match1(html,r"<title>(.*?)</title>").split("|")[:-2]))
|
||||
|
||||
#mgid%3Auma%3Avideo%3Amtv81.com%3A897974
|
||||
vid=match1(html,r'getTheVideo\("(.*?)"')
|
||||
xml=parseString(get_content("http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri={}&flashPlayer=LNX%2013,0,0,206&geo=CN&sid=123456".format(vid)))
|
||||
def mtv81_download(url, output_dir='.', merge=True, info_only=False):
|
||||
html = get_content(url)
|
||||
title = unescape(
|
||||
"|".join(match1(html, r"<title>(.*?)</title>").split("|")[:-2]))
|
||||
|
||||
url=sorted(map(lambda x:x.firstChild.nodeValue,xml.getElementsByTagName("src")),key=lambda x:int(match1(x,r'_(\d+?)_')))[-1]
|
||||
# mgid%3Auma%3Avideo%3Amtv81.com%3A897974
|
||||
vid = match1(html, r'getTheVideo\("(.*?)"')
|
||||
xml = parseString(
|
||||
get_content("http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri={}&flashPlayer=LNX%2013,0,0,206&geo=CN&sid=123456".format(vid)))
|
||||
|
||||
url = sorted(
|
||||
map(lambda x: x.firstChild.nodeValue, xml.getElementsByTagName("src")),
|
||||
key=lambda x: int(match1(x, r'_(\d+?)_')))[-1]
|
||||
|
||||
mediatype, ext, size = 'mp4', 'mp4', 0
|
||||
print_info(site_info, title, mediatype, size)
|
||||
##
|
||||
#
|
||||
# rtmpdump -r 'rtmpe://cp30865.edgefcs.net/ondemand/mtviestor/_!/intlod/MTVInternational/MBUS/GeoLocals/00JP/VIAMTVI/PYC/201304/7122HVAQ4/00JPVIAMTVIPYC7122HVAQ4_640x_360_1200_m30.mp4' -o "title.mp4" --swfVfy http://media.mtvnservices.com/player/prime/mediaplayerprime.1.10.8.swf
|
||||
##
|
||||
#
|
||||
# because rtmpdump is unstable,may try serveral times
|
||||
##
|
||||
#
|
||||
if not info_only:
|
||||
# import pdb
|
||||
# pdb.set_trace()
|
||||
download_rtmp_url(url=url, title=title, ext=ext, params={"--swfVfy":"http://media.mtvnservices.com/player/prime/mediaplayerprime.1.10.8.swf"}, output_dir=output_dir)
|
||||
|
||||
download_rtmp_url(url=url, title=title, ext=ext, params={
|
||||
"--swfVfy": "http://media.mtvnservices.com/player/prime/mediaplayerprime.1.10.8.swf"}, output_dir=output_dir)
|
||||
|
||||
|
||||
site_info = "mtv81.com"
|
||||
|
Loading…
x
Reference in New Issue
Block a user