Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix 2 bugs in youtube_dl/extractor/sohu.py #2004

Closed
wants to merge 3 commits into from

1 participant

Yen Chi Hsuan
Yen Chi Hsuan
  1. Highest quality is the first one in ('ori', 'super', 'high', 'nor') Their chinese names are 原画, 超清, 高清, 标清, respectively
  2. Sohu's server can't identify duplicate slashes in the url.

An example that the old extractor does not work properly:
http://tv.sohu.com/20130710/n381244182.shtml

Yen Chi Hsuan yan12125 Fix 2 bugs in youtube_dl/extractor/sohu.py
1. Highest quality is the first one in ('ori', 'super', 'high', 'nor')
   Their chinese names are 原画, 超清, 高清, 标清, respectively
2. Sohu's server can't identify duplicate slashes in the url.
cc54abb
Yen Chi Hsuan

Seems Sohu has fixed the bug related to duplicate slashes, but a more concise URL should lead to less bugs.

Yen Chi Hsuan yan12125 closed this
Yen Chi Hsuan yan12125 deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2013
  1. Yen Chi Hsuan

    Fix 2 bugs in youtube_dl/extractor/sohu.py

    yan12125 authored
    1. Highest quality is the first one in ('ori', 'super', 'high', 'nor')
       Their chinese names are 原画, 超清, 高清, 标清, respectively
    2. Sohu's server can't identify duplicate slashes in the url.
  2. Yen Chi Hsuan
  3. Yen Chi Hsuan

    [Sohu] Fix a test failure due to md5 errors

    yan12125 authored
    Only the first 10240 bytes are calculated in tests
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 youtube_dl/extractor/sohu.py
9 youtube_dl/extractor/sohu.py
View
@@ -13,7 +13,7 @@ class SohuIE(InfoExtractor):
_TEST = {
u'url': u'http://tv.sohu.com/20130724/n382479172.shtml#super',
u'file': u'382479172.mp4',
- u'md5': u'bde8d9a6ffd82c63a1eefaef4eeefec7',
+ u'md5': u'29175c8cadd8b5cc4055001e85d6b372',
u'info_dict': {
u'title': u'MV:Far East Movement《The Illest》',
},
@@ -53,7 +53,7 @@ def _fetch_data(vid_id, mytv=False):
raise ExtractorError(u'No formats available for this video')
# For now, we just pick the highest available quality
- vid_id = vid_ids[-1]
+ vid_id = vid_ids[0]
format_data = data if vid == vid_id else _fetch_data(vid_id, mytv)
part_count = format_data['data']['totalBlocks']
@@ -71,7 +71,10 @@ def _fetch_data(vid_id, mytv=False):
note=u'Downloading part %d of %d' % (i+1, part_count))
part_info = part_str.split('|')
- video_url = '%s%s?key=%s' % (part_info[0], su[i], part_info[3])
+ if part_info[0][-1] == '/' and su[i][0] == '/':
+ video_url = '%s%s?key=%s' % (part_info[0], su[i][1:], part_info[3])
+ else:
+ video_url = '%s%s?key=%s' % (part_info[0], su[i], part_info[3])
video_info = {
'id': '%s_part%02d' % (video_id, i + 1),
Something went wrong with that request. Please try again.