From 8865bdeb377bc653cea66305af9bf530440771c4 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 26 Nov 2014 13:06:02 +0100 Subject: [PATCH] Remove useless u prefixes --- youtube_dl/extractor/cbs.py | 2 +- youtube_dl/extractor/clipfish.py | 4 ++-- youtube_dl/extractor/eighttracks.py | 2 +- youtube_dl/extractor/gamekings.py | 2 +- youtube_dl/extractor/mooshare.py | 2 +- youtube_dl/extractor/mtv.py | 2 +- youtube_dl/extractor/nhl.py | 6 ++++-- youtube_dl/extractor/sohu.py | 6 +++--- youtube_dl/extractor/space.py | 3 ++- youtube_dl/extractor/tudou.py | 2 +- youtube_dl/extractor/youporn.py | 4 ++-- 11 files changed, 19 insertions(+), 16 deletions(-) diff --git a/youtube_dl/extractor/cbs.py b/youtube_dl/extractor/cbs.py index db48dc24f..e43756ec6 100644 --- a/youtube_dl/extractor/cbs.py +++ b/youtube_dl/extractor/cbs.py @@ -45,4 +45,4 @@ class CBSIE(InfoExtractor): real_id = self._search_regex( r"video\.settings\.pid\s*=\s*'([^']+)';", webpage, 'real video ID') - return self.url_result(u'theplatform:%s' % real_id) + return self.url_result('theplatform:%s' % real_id) diff --git a/youtube_dl/extractor/clipfish.py b/youtube_dl/extractor/clipfish.py index 669919a2c..a5c3cb7c6 100644 --- a/youtube_dl/extractor/clipfish.py +++ b/youtube_dl/extractor/clipfish.py @@ -24,7 +24,7 @@ class ClipfishIE(InfoExtractor): 'title': 'FIFA 14 - E3 2013 Trailer', 'duration': 82, }, - u'skip': 'Blocked in the US' + 'skip': 'Blocked in the US' } def _real_extract(self, url): @@ -34,7 +34,7 @@ class ClipfishIE(InfoExtractor): info_url = ('http://www.clipfish.de/devxml/videoinfo/%s?ts=%d' % (video_id, int(time.time()))) doc = self._download_xml( - info_url, video_id, note=u'Downloading info page') + info_url, video_id, note='Downloading info page') title = doc.find('title').text video_url = doc.find('filename').text if video_url is None: diff --git a/youtube_dl/extractor/eighttracks.py b/youtube_dl/extractor/eighttracks.py index c1b4c729e..f4c1e2a72 100644 --- a/youtube_dl/extractor/eighttracks.py +++ b/youtube_dl/extractor/eighttracks.py @@ -125,7 +125,7 @@ class EightTracksIE(InfoExtractor): info = { 'id': compat_str(track_data['id']), 'url': track_data['track_file_stream_url'], - 'title': track_data['performer'] + u' - ' + track_data['name'], + 'title': track_data['performer'] + ' - ' + track_data['name'], 'raw_title': track_data['name'], 'uploader_id': data['user']['login'], 'ext': 'm4a', diff --git a/youtube_dl/extractor/gamekings.py b/youtube_dl/extractor/gamekings.py index 11fee3d31..cf8e90d7d 100644 --- a/youtube_dl/extractor/gamekings.py +++ b/youtube_dl/extractor/gamekings.py @@ -11,7 +11,7 @@ class GamekingsIE(InfoExtractor): 'url': 'http://www.gamekings.tv/videos/phoenix-wright-ace-attorney-dual-destinies-review/', # MD5 is flaky, seems to change regularly # 'md5': '2f32b1f7b80fdc5cb616efb4f387f8a3', - u'info_dict': { + 'info_dict': { 'id': '20130811', 'ext': 'mp4', 'title': 'Phoenix Wright: Ace Attorney \u2013 Dual Destinies Review', diff --git a/youtube_dl/extractor/mooshare.py b/youtube_dl/extractor/mooshare.py index f50e432a3..34a4bec3a 100644 --- a/youtube_dl/extractor/mooshare.py +++ b/youtube_dl/extractor/mooshare.py @@ -49,7 +49,7 @@ class MooshareIE(InfoExtractor): page = self._download_webpage(url, video_id, 'Downloading page') if re.search(r'>Video Not Found or Deleted<', page) is not None: - raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) + raise ExtractorError('Video %s does not exist' % video_id, expected=True) hash_key = self._html_search_regex(r'', page, 'hash') title = self._html_search_regex(r'(?m)
\s*

Watch ([^<]+)

', page, 'title') diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index 506d2d5a0..b482d6d4d 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -164,7 +164,7 @@ class MTVServicesInfoExtractor(InfoExtractor): if mgid is None or ':' not in mgid: mgid = self._search_regex( [r'data-mgid="(.*?)"', r'swfobject.embedSWF\(".*?(mgid:.*?)"'], - webpage, u'mgid') + webpage, 'mgid') return self._get_videos_info(mgid) diff --git a/youtube_dl/extractor/nhl.py b/youtube_dl/extractor/nhl.py index 719eb51a4..bdcf7e239 100644 --- a/youtube_dl/extractor/nhl.py +++ b/youtube_dl/extractor/nhl.py @@ -4,9 +4,11 @@ import re import json from .common import InfoExtractor -from ..utils import ( +from ..compat import ( compat_urlparse, compat_urllib_parse, +) +from ..utils import ( unified_strdate, ) @@ -122,7 +124,7 @@ class NHLVideocenterIE(NHLBaseInfoExtractor): response = self._download_webpage(request_url, playlist_title) response = self._fix_json(response) if not response.strip(): - self._downloader.report_warning(u'Got an empty reponse, trying ' + self._downloader.report_warning('Got an empty reponse, trying ' 'adding the "newvideos" parameter') response = self._download_webpage(request_url + '&newvideos=true', playlist_title) diff --git a/youtube_dl/extractor/sohu.py b/youtube_dl/extractor/sohu.py index 331b345dc..07f514a46 100644 --- a/youtube_dl/extractor/sohu.py +++ b/youtube_dl/extractor/sohu.py @@ -32,7 +32,7 @@ class SohuIE(InfoExtractor): data_url = base_data_url + str(vid_id) data_json = self._download_webpage( data_url, video_id, - note=u'Downloading JSON data for ' + str(vid_id)) + note='Downloading JSON data for ' + str(vid_id)) return json.loads(data_json) mobj = re.match(self._VALID_URL, url) @@ -53,7 +53,7 @@ class SohuIE(InfoExtractor): for q in QUALITIES if data['data'][q + 'Vid'] != 0] if not vid_ids: - raise ExtractorError(u'No formats available for this video') + raise ExtractorError('No formats available for this video') # For now, we just pick the highest available quality vid_id = vid_ids[-1] @@ -71,7 +71,7 @@ class SohuIE(InfoExtractor): (allot, prot, clipsURL[i], su[i])) part_str = self._download_webpage( part_url, video_id, - note=u'Downloading part %d of %d' % (i + 1, part_count)) + note='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]) diff --git a/youtube_dl/extractor/space.py b/youtube_dl/extractor/space.py index d34aefeaa..c2d0d36a6 100644 --- a/youtube_dl/extractor/space.py +++ b/youtube_dl/extractor/space.py @@ -33,5 +33,6 @@ class SpaceIE(InfoExtractor): # Other videos works fine with the info from the object brightcove_url = BrightcoveIE._extract_brightcove_url(webpage) if brightcove_url is None: - raise ExtractorError(u'The webpage does not contain a video', expected=True) + raise ExtractorError( + 'The webpage does not contain a video', expected=True) return self.url_result(brightcove_url, BrightcoveIE.ie_key()) diff --git a/youtube_dl/extractor/tudou.py b/youtube_dl/extractor/tudou.py index be51f4f87..161e47624 100644 --- a/youtube_dl/extractor/tudou.py +++ b/youtube_dl/extractor/tudou.py @@ -73,7 +73,7 @@ class TudouIE(InfoExtractor): result = [] len_parts = len(parts) if len_parts > 1: - self.to_screen(u'%s: found %s parts' % (video_id, len_parts)) + self.to_screen('%s: found %s parts' % (video_id, len_parts)) for part in parts: part_id = part['k'] final_url = self._url_for_id(part_id, quality) diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py index 97ef9c17e..8123928be 100644 --- a/youtube_dl/extractor/youporn.py +++ b/youtube_dl/extractor/youporn.py @@ -49,7 +49,7 @@ class YouPornIE(InfoExtractor): try: params = json.loads(json_params) except: - raise ExtractorError(u'Invalid JSON') + raise ExtractorError('Invalid JSON') self.report_extraction(video_id) try: @@ -103,7 +103,7 @@ class YouPornIE(InfoExtractor): self._sort_formats(formats) if not formats: - raise ExtractorError(u'ERROR: no known formats available for video') + raise ExtractorError('ERROR: no known formats available for video') return { 'id': video_id, -- 2.22.2