Hello community,

here is the log from the commit of package you-get for openSUSE:Factory checked 
in at 2020-03-03 10:18:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/you-get (Old)
 and      /work/SRC/openSUSE:Factory/.you-get.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "you-get"

Tue Mar  3 10:18:43 2020 rev:29 rq:781000 version:0.4.1410

Changes:
--------
--- /work/SRC/openSUSE:Factory/you-get/you-get.changes  2020-01-27 
20:19:36.084601788 +0100
+++ /work/SRC/openSUSE:Factory/.you-get.new.26092/you-get.changes       
2020-03-03 10:20:31.967183229 +0100
@@ -1,0 +2,5 @@
+Mon Mar  2 15:14:23 UTC 2020 - [email protected]
+
+- Update to version 0.4.1410 (no changelog supplied)
+
+-------------------------------------------------------------------

Old:
----
  you-get-0.4.1403.tar.gz

New:
----
  you-get-0.4.1410.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ you-get.spec ++++++
--- /var/tmp/diff_new_pack.b3UIg0/_old  2020-03-03 10:20:33.431186258 +0100
+++ /var/tmp/diff_new_pack.b3UIg0/_new  2020-03-03 10:20:33.431186258 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           you-get
-Version:        0.4.1403
+Version:        0.4.1410
 Release:        0
 Summary:        Dumb downloader that scrapes the web
 License:        MIT

++++++ you-get-0.4.1403.tar.gz -> you-get-0.4.1410.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/extractors/coub.py 
new/you-get-0.4.1410/src/you_get/extractors/coub.py
--- old/you-get-0.4.1403/src/you_get/extractors/coub.py 2020-01-27 
00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/src/you_get/extractors/coub.py 2020-03-02 
14:45:57.000000000 +0100
@@ -79,7 +79,7 @@
 
 
 def get_coub_data(html):
-    coub_data = r1(r'<script id=\'coubPageCoubJson\' 
type=\'text/json\'>([^<]+)</script>', html)
+    coub_data = r1(r'<script id=\'coubPageCoubJson\' 
type=\'text/json\'>([\w\W]+?(?=</script>))</script>', html)
     json_data = json.loads(coub_data)
     return json_data
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/extractors/iwara.py 
new/you-get-0.4.1410/src/you_get/extractors/iwara.py
--- old/you-get-0.4.1403/src/you_get/extractors/iwara.py        2020-01-27 
00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/src/you_get/extractors/iwara.py        2020-03-02 
14:45:57.000000000 +0100
@@ -9,12 +9,15 @@
     'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
     'Accept': 
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
     'Cache-Control': 'max-age=0',
-
     'Connection': 'keep-alive',
     'Save-Data': 'on',
     'Cookie':'has_js=1;show_adult=1',
 }
-
+stream_types = [
+        {'id': 'Source',      'container': 'mp4', 'video_profile': '原始'},
+        {'id': '540p',    'container': 'mp4', 'video_profile': '540p'},
+        {'id': '360p',   'container': 'mp4', 'video_profile': '360P'},
+    ]
 def iwara_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
     global headers
     video_hash = match1(url, r'https?://\w+.iwara.tv/videos/(\w+)')
@@ -31,6 +34,17 @@
     if not info_only:
         download_urls([down_urls], title, ext, size, output_dir, merge=merge, 
headers=headers)
 
+def download_playlist_by_url( url, **kwargs):
+    video_page = get_content(url)
+    # url_first=re.findall(r"(http[s]?://[^/]+)",url)
+    url_first=match1(url, r"(http[s]?://[^/]+)")
+    # print (url_first)
+    videos = set(re.findall(r'<a href="(/videos/[^"]+)"', video_page))
+    if(len(videos)>0):
+        for video in videos:
+            iwara_download(url_first+video, **kwargs)
+    else:
+        maybe_print('this page not found any videos')
 site_info = "Iwara"
 download = iwara_download
-download_playlist = playlist_not_supported('iwara')
+download_playlist = download_playlist_by_url
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/extractors/qq.py 
new/you-get-0.4.1410/src/you_get/extractors/qq.py
--- old/you-get-0.4.1403/src/you_get/extractors/qq.py   2020-01-27 
00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/src/you_get/extractors/qq.py   2020-03-02 
14:45:57.000000000 +0100
@@ -6,6 +6,10 @@
 from .qie_video import download_by_url as qie_video_download
 from ..common import *
 
+headers = {
+    'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
(KHTML, like Gecko)  QQLive/10275340/50192209 Chrome/43.0.2357.134 
Safari/537.36 QBCore/3.43.561.202 QQBrowser/9.0.2524.400'
+}
+
 
 def qq_download_by_vid(vid, title, output_dir='.', merge=True, 
info_only=False):
 
@@ -14,7 +18,7 @@
     platforms = [4100201, 11]
     for platform in platforms:
         info_api = 
'http://vv.video.qq.com/getinfo?otype=json&appver=3.2.19.333&platform={}&defnpayver=1&defn=shd&vid={}'.format(platform,
 vid)
-        info = get_content(info_api)
+        info = get_content(info_api, headers)
         video_json = json.loads(match1(info, r'QZOutputJson=(.*)')[:-1])
         if not video_json.get('msg')=='cannot play outside':
             break
@@ -41,7 +45,7 @@
             filename = '.'.join([fn_pre, magic_str, str(part), video_type])
 
         key_api = 
"http://vv.video.qq.com/getkey?otype=json&platform=11&format={}&vid={}&filename={}&appver=3.2.19.333".format(part_format_id,
 vid, filename)
-        part_info = get_content(key_api)
+        part_info = get_content(key_api, headers)
         key_json = json.loads(match1(part_info, r'QZOutputJson=(.*)')[:-1])
         if key_json.get('key') is None:
             vkey = video_json['vl']['vi'][0]['fvkey']
@@ -71,7 +75,7 @@
     BASE_URL = 'http://cgi.kg.qq.com/fcgi-bin/kg_ugc_getdetail'
     params_str = 
'?dataType=jsonp&jsonp=callback&jsonpCallback=jsopgetsonginfo&v=4&outCharset=utf-8&shareid='
 + shareid
     url = BASE_URL + params_str
-    content = get_content(url)
+    content = get_content(url, headers)
     json_str = content[len('jsonpcallback('):-1]
     json_data = json.loads(json_str)
 
@@ -127,7 +131,7 @@
         return
 
     if 'mp.weixin.qq.com/s' in url:
-        content = get_content(url)
+        content = get_content(url, headers)
         vids = matchall(content, [r'[?;]vid=(\w+)'])
         for vid in vids:
             qq_download_by_vid(vid, vid, output_dir, merge, info_only)
@@ -142,7 +146,7 @@
         title=info_json['videoinfo']['title']
     elif 'kuaibao.qq.com' in url or 
re.match(r'http://daxue.qq.com/content/content/id/\d+', url):
         # http://daxue.qq.com/content/content/id/2321
-        content = get_content(url)
+        content = get_content(url, headers)
         vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
         title = match1(content, r'title">([^"]+)</p>')
         title = title.strip() if title else vid
@@ -152,11 +156,11 @@
         title = vid
     elif 'view.inews.qq.com' in url:
         # view.inews.qq.com/a/20180521V0Z9MH00
-        content = get_content(url)
+        content = get_content(url, headers)
         vid = match1(content, r'"vid":"(\w+)"')
         title = match1(content, r'"title":"(\w+)"')
     else:
-        content = get_content(url)
+        content = get_content(url, headers)
         #vid = parse_qs(urlparse(url).query).get('vid') #for links specified 
vid  like http://v.qq.com/cover/p/ps6mnfqyrfo7es3.html?vid=q0181hpdvo5
         rurl = match1(content, 
r'<link.*?rel\s*=\s*"canonical".*?href\s*="(.+?)".*?>') 
#https://v.qq.com/x/cover/9hpjiv5fhiyn86u/t0522x58xma.html
         vid = ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/extractors/youtube.py 
new/you-get-0.4.1410/src/you_get/extractors/youtube.py
--- old/you-get-0.4.1403/src/you_get/extractors/youtube.py      2020-01-27 
00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/src/you_get/extractors/youtube.py      2020-03-02 
14:45:57.000000000 +0100
@@ -218,7 +218,10 @@
                     ytplayer_config = 
json.loads(re.search('ytplayer.config\s*=\s*([^\n]+?});', video_page).group(1))
                     self.html5player = 'https://www.youtube.com' + 
ytplayer_config['assets']['js']
                     # Workaround: get_video_info returns bad s. Why?
-                    stream_list = 
ytplayer_config['args']['url_encoded_fmt_stream_map'].split(',')
+                    if 'url_encoded_fmt_stream_map' not in 
ytplayer_config['args']:
+                        stream_list = 
json.loads(ytplayer_config['args']['player_response'])['streamingData']['formats']
+                    else:
+                        stream_list = 
ytplayer_config['args']['url_encoded_fmt_stream_map'].split(',')
                     #stream_list = 
ytplayer_config['args']['adaptive_fmts'].split(',')
                 except:
                     if 'url_encoded_fmt_stream_map' not in video_info:
@@ -321,7 +324,7 @@
                     'container': 
mime_to_container(metadata['type'][0].split(';')[0]),
                 }
             else:
-                stream_itag = stream['itag']
+                stream_itag = str(stream['itag'])
                 self.streams[stream_itag] = {
                     'itag': str(stream['itag']),
                     'url': stream['url'] if 'url' in stream else None,
@@ -367,7 +370,7 @@
                 self.caption_tracks[lang] = srt
         except: pass
 
-        # Prepare DASH streams
+        # Prepare DASH streams (NOTE: not every video has DASH streams!)
         try:
             dashmpd = ytplayer_config['args']['dashmpd']
             dash_xml = parseString(get_content(dashmpd))
@@ -451,7 +454,10 @@
                                      for i in afmt.split('&')])
                                for afmt in 
video_info['adaptive_fmts'][0].split(',')]
                 else:
-                    streams = 
json.loads(video_info['player_response'][0])['streamingData']['adaptiveFormats']
+                    try:
+                        streams = 
json.loads(video_info['player_response'][0])['streamingData']['adaptiveFormats']
+                    except:  # no DASH stream at all
+                        return
                     # streams without contentLength got broken urls, just 
remove them (#2767)
                     streams = [stream for stream in streams if 'contentLength' 
in stream]
                     for stream in streams:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/json_output.py 
new/you-get-0.4.1410/src/you_get/json_output.py
--- old/you-get-0.4.1403/src/you_get/json_output.py     2020-01-27 
00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/src/you_get/json_output.py     2020-03-02 
14:45:57.000000000 +0100
@@ -29,7 +29,7 @@
     if extra:
         out["extra"] = extra
     if pretty_print:
-        print(json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False))
+        print(json.dumps(out, indent=4, ensure_ascii=False))
     else:
         print(json.dumps(out))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/src/you_get/version.py 
new/you-get-0.4.1410/src/you_get/version.py
--- old/you-get-0.4.1403/src/you_get/version.py 2020-01-27 00:27:15.000000000 
+0100
+++ new/you-get-0.4.1410/src/you_get/version.py 2020-03-02 14:45:57.000000000 
+0100
@@ -1,4 +1,4 @@
 #!/usr/bin/env python
 
 script_name = 'you-get'
-__version__ = '0.4.1403'
+__version__ = '0.4.1410'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/you-get-0.4.1403/tests/test.py 
new/you-get-0.4.1410/tests/test.py
--- old/you-get-0.4.1403/tests/test.py  2020-01-27 00:27:15.000000000 +0100
+++ new/you-get-0.4.1410/tests/test.py  2020-03-02 14:45:57.000000000 +0100
@@ -37,6 +37,9 @@
             
'http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare',
  # noqa
             info_only=True
         )
+        youtube.download(
+            'https://www.youtube.com/watch?v=Fpr4fQSh1cc', info_only=True
+        )
 
     def test_acfun(self):
         acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True)


Reply via email to