mirror of
https://github.com/soimort/you-get.git
synced 2025-02-13 13:35:20 +03:00
Merge branch 'soimort:develop' into develop
This commit is contained in:
commit
5af3235c93
@ -73,7 +73,7 @@ def get_api_key(page):
|
|||||||
match = match1(page, pattern_inline_api_key)
|
match = match1(page, pattern_inline_api_key)
|
||||||
# this happens only when the url points to a gallery page
|
# this happens only when the url points to a gallery page
|
||||||
# that contains no inline api_key(and never makes xhr api calls)
|
# that contains no inline api_key(and never makes xhr api calls)
|
||||||
# in fact this might be a better approch for getting a temporary api key
|
# in fact this might be a better approach for getting a temporary api key
|
||||||
# since there's no place for a user to add custom information that may
|
# since there's no place for a user to add custom information that may
|
||||||
# misguide the regex in the homepage
|
# misguide the regex in the homepage
|
||||||
if not match:
|
if not match:
|
||||||
|
@ -27,6 +27,9 @@ def iwara_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
api_url = video_url + '/api/video/' + video_hash
|
api_url = video_url + '/api/video/' + video_hash
|
||||||
content = get_content(api_url, headers=headers)
|
content = get_content(api_url, headers=headers)
|
||||||
data = json.loads(content)
|
data = json.loads(content)
|
||||||
|
if len(data)<1 :
|
||||||
|
print('Maybe is Private Video?'+'['+title+']')
|
||||||
|
return True;
|
||||||
down_urls = 'https:' + data[0]['uri']
|
down_urls = 'https:' + data[0]['uri']
|
||||||
type, ext, size = url_info(down_urls, headers=headers)
|
type, ext, size = url_info(down_urls, headers=headers)
|
||||||
print_info(site_info, title+data[0]['resolution'], type, size)
|
print_info(site_info, title+data[0]['resolution'], type, size)
|
||||||
@ -35,10 +38,8 @@ def iwara_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
download_urls([down_urls], title, ext, size, output_dir, merge=merge, headers=headers)
|
download_urls([down_urls], title, ext, size, output_dir, merge=merge, headers=headers)
|
||||||
|
|
||||||
def download_playlist_by_url( url, **kwargs):
|
def download_playlist_by_url( url, **kwargs):
|
||||||
video_page = get_content(url)
|
video_page = get_html(url)
|
||||||
# url_first=re.findall(r"(http[s]?://[^/]+)",url)
|
|
||||||
url_first=match1(url, r"(http[s]?://[^/]+)")
|
url_first=match1(url, r"(http[s]?://[^/]+)")
|
||||||
# print (url_first)
|
|
||||||
videos = set(re.findall(r'<a href="(/videos/[^"]+)"', video_page))
|
videos = set(re.findall(r'<a href="(/videos/[^"]+)"', video_page))
|
||||||
if(len(videos)>0):
|
if(len(videos)>0):
|
||||||
for video in videos:
|
for video in videos:
|
||||||
|
@ -28,7 +28,7 @@ def mtv81_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
#
|
#
|
||||||
# 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
|
# 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
|
# because rtmpdump is unstable,may try several times
|
||||||
#
|
#
|
||||||
if not info_only:
|
if not info_only:
|
||||||
# import pdb
|
# import pdb
|
||||||
|
@ -10,7 +10,7 @@ __all__ = ['qingting_download_by_url']
|
|||||||
|
|
||||||
class Qingting(VideoExtractor):
|
class Qingting(VideoExtractor):
|
||||||
# every resource is described by its channel id and program id
|
# every resource is described by its channel id and program id
|
||||||
# so vid is tuple (chaanel_id, program_id)
|
# so vid is tuple (channel_id, program_id)
|
||||||
|
|
||||||
name = 'Qingting'
|
name = 'Qingting'
|
||||||
stream_types = [
|
stream_types = [
|
||||||
|
@ -77,10 +77,11 @@ class YouTube(VideoExtractor):
|
|||||||
# - https://www.youtube.com/yts/jsbin/player-vflRjqq_w/da_DK/base.js
|
# - https://www.youtube.com/yts/jsbin/player-vflRjqq_w/da_DK/base.js
|
||||||
# - https://www.youtube.com/yts/jsbin/player_ias-vfl-jbnrr/da_DK/base.js
|
# - https://www.youtube.com/yts/jsbin/player_ias-vfl-jbnrr/da_DK/base.js
|
||||||
# - https://www.youtube.com/s/player/0b643cd1/player_ias.vflset/sv_SE/base.js
|
# - https://www.youtube.com/s/player/0b643cd1/player_ias.vflset/sv_SE/base.js
|
||||||
|
# - https://www.youtube.com/s/player/50e823fc/player_ias.vflset/sv_SE/base.js
|
||||||
def tr_js(code):
|
def tr_js(code):
|
||||||
code = re.sub(r'function', r'def', code)
|
code = re.sub(r'function', r'def', code)
|
||||||
# add prefix '_sig_' to prevent namespace pollution
|
# add prefix '_sig_' to prevent namespace pollution
|
||||||
code = re.sub(r'(\W)([$\w][$\w])\(', r'\1_sig_\2(', code)
|
code = re.sub(r'(\W)([$\w][$\w][$\w]?)\(', r'\1_sig_\2(', code)
|
||||||
code = re.sub(r'\$', '_dollar', code)
|
code = re.sub(r'\$', '_dollar', code)
|
||||||
code = re.sub(r'\{', r': ', code)
|
code = re.sub(r'\{', r': ', code)
|
||||||
code = re.sub(r'\}', r'\n', code)
|
code = re.sub(r'\}', r'\n', code)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
script_name = 'you-get'
|
script_name = 'you-get'
|
||||||
__version__ = '0.4.1536'
|
__version__ = '0.4.1545'
|
||||||
|
@ -40,11 +40,11 @@ class YouGetTests(unittest.TestCase):
|
|||||||
def test_acfun(self):
|
def test_acfun(self):
|
||||||
acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True)
|
acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True)
|
||||||
|
|
||||||
def test_soundcloud(self):
|
#def test_soundcloud(self):
|
||||||
## single song
|
## single song
|
||||||
soundcloud.download(
|
#soundcloud.download(
|
||||||
'https://soundcloud.com/keiny-pham/impure-bird', info_only=True
|
# 'https://soundcloud.com/keiny-pham/impure-bird', info_only=True
|
||||||
)
|
#)
|
||||||
## playlist
|
## playlist
|
||||||
#soundcloud.download(
|
#soundcloud.download(
|
||||||
# 'https://soundcloud.com/anthony-flieger/sets/cytus', info_only=True
|
# 'https://soundcloud.com/anthony-flieger/sets/cytus', info_only=True
|
||||||
|
Loading…
Reference in New Issue
Block a user