1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-27 17:22:50 +08:00

Clean up unused imports and other minor mistakes

This commit is contained in:
Philipp Hagemeister 2013-11-20 06:27:48 +01:00
parent cc13cc0251
commit f3682997d7
16 changed files with 5 additions and 21 deletions

View File

@ -71,10 +71,8 @@ class CollegeHumorIE(InfoExtractor):
adoc = xml.etree.ElementTree.fromstring(manifestXml) adoc = xml.etree.ElementTree.fromstring(manifestXml)
try: try:
media_node = adoc.findall('./{http://ns.adobe.com/f4m/1.0}media')[0]
node_id = media_node.attrib['url']
video_id = adoc.findall('./{http://ns.adobe.com/f4m/1.0}id')[0].text video_id = adoc.findall('./{http://ns.adobe.com/f4m/1.0}id')[0].text
except IndexError as err: except IndexError:
raise ExtractorError(u'Invalid manifest file') raise ExtractorError(u'Invalid manifest file')
url_pr = compat_urllib_parse_urlparse(info['thumbnail']) url_pr = compat_urllib_parse_urlparse(info['thumbnail'])
info['url'] = url_pr.scheme + '://' + url_pr.netloc + video_id[:-2].replace('.csmil','').replace(',','') info['url'] = url_pr.scheme + '://' + url_pr.netloc + video_id[:-2].replace('.csmil','').replace(',','')

View File

@ -1,4 +1,3 @@
import itertools
import json import json
import random import random
import re import re

View File

@ -1,5 +1,4 @@
import json import json
import netrc
import re import re
import socket import socket

View File

@ -39,7 +39,6 @@ class FKTVIE(InfoExtractor):
for i, _ in enumerate(files, 1): for i, _ in enumerate(files, 1):
video_id = '%04d%d' % (episode, i) video_id = '%04d%d' % (episode, i)
video_url = 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server, episode, '' if i == 1 else '-%d' % i) video_url = 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server, episode, '' if i == 1 else '-%d' % i)
video_title = 'Fernsehkritik %d.%d' % (episode, i)
videos.append({ videos.append({
'id': video_id, 'id': video_id,
'url': video_url, 'url': video_url,

View File

@ -24,7 +24,7 @@ class GameSpotIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
page_id = video_id = mobj.group('page_id') page_id = mobj.group('page_id')
webpage = self._download_webpage(url, page_id) webpage = self._download_webpage(url, page_id)
data_video_json = self._search_regex(r'data-video=\'(.*?)\'', webpage, u'data video') data_video_json = self._search_regex(r'data-video=\'(.*?)\'', webpage, u'data video')
data_video = json.loads(unescapeHTML(data_video_json)) data_video = json.loads(unescapeHTML(data_video_json))

View File

@ -22,7 +22,7 @@ class JeuxVideoIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
title = re.match(self._VALID_URL, url).group(1) title = mobj.group(1)
webpage = self._download_webpage(url, title) webpage = self._download_webpage(url, title)
xml_link = self._html_search_regex( xml_link = self._html_search_regex(
r'<param name="flashvars" value="config=(.*?)" />', r'<param name="flashvars" value="config=(.*?)" />',

View File

@ -6,9 +6,7 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urlparse, compat_urlparse,
get_meta_content,
xpath_with_ns, xpath_with_ns,
ExtractorError,
) )

View File

@ -59,7 +59,6 @@ class MTVIE(InfoExtractor):
if '/error_country_block.swf' in metadataXml: if '/error_country_block.swf' in metadataXml:
raise ExtractorError(u'This video is not available from your country.', expected=True) raise ExtractorError(u'This video is not available from your country.', expected=True)
mdoc = xml.etree.ElementTree.fromstring(metadataXml.encode('utf-8')) mdoc = xml.etree.ElementTree.fromstring(metadataXml.encode('utf-8'))
renditions = mdoc.findall('.//rendition')
formats = [] formats = []
for rendition in mdoc.findall('.//rendition'): for rendition in mdoc.findall('.//rendition'):

View File

@ -6,7 +6,6 @@ from ..utils import (
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urllib_request, compat_urllib_request,
compat_urllib_parse, compat_urllib_parse,
unescapeHTML,
) )
from ..aes import ( from ..aes import (
aes_decrypt_text aes_decrypt_text

View File

@ -158,7 +158,6 @@ class SoundcloudSetIE(SoundcloudIE):
resolv_url = self._resolv_url(url) resolv_url = self._resolv_url(url)
info_json = self._download_webpage(resolv_url, full_title) info_json = self._download_webpage(resolv_url, full_title)
videos = []
info = json.loads(info_json) info = json.loads(info_json)
if 'errors' in info: if 'errors' in info:
for err in info['errors']: for err in info['errors']:

View File

@ -6,7 +6,6 @@ from ..utils import (
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urllib_request, compat_urllib_request,
compat_urllib_parse, compat_urllib_parse,
unescapeHTML,
) )
from ..aes import ( from ..aes import (
aes_decrypt_text aes_decrypt_text

View File

@ -2,7 +2,6 @@ import re
import xml.etree.ElementTree import xml.etree.ElementTree
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import determine_ext
class SpiegelIE(InfoExtractor): class SpiegelIE(InfoExtractor):

View File

@ -4,7 +4,6 @@ import re
from .subtitles import SubtitlesInfoExtractor from .subtitles import SubtitlesInfoExtractor
from ..utils import ( from ..utils import (
compat_str,
RegexNotFoundError, RegexNotFoundError,
) )
@ -113,6 +112,6 @@ class TEDIE(SubtitlesInfoExtractor):
url = 'http://www.ted.com/talks/subtitles/id/%s/lang/%s/format/srt' % (video_id, l) url = 'http://www.ted.com/talks/subtitles/id/%s/lang/%s/format/srt' % (video_id, l)
sub_lang_list[l] = url sub_lang_list[l] = url
return sub_lang_list return sub_lang_list
except RegexNotFoundError as err: except RegexNotFoundError:
self._downloader.report_warning(u'video doesn\'t have subtitles') self._downloader.report_warning(u'video doesn\'t have subtitles')
return {} return {}

View File

@ -5,8 +5,6 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urllib_request, compat_urllib_request,
compat_urllib_parse,
unescapeHTML,
) )
from ..aes import ( from ..aes import (
aes_decrypt_text aes_decrypt_text

View File

@ -5,7 +5,6 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urllib_request, compat_urllib_request,
compat_urllib_parse,
) )
class XTubeIE(InfoExtractor): class XTubeIE(InfoExtractor):

View File

@ -53,7 +53,7 @@ class ZDFIE(InfoExtractor):
video_id, video_id,
u'Get stream URL') u'Get stream URL')
MMS_STREAM = r'href="(?P<video_url>mms://[^"]*)"' #MMS_STREAM = r'href="(?P<video_url>mms://[^"]*)"'
RTSP_STREAM = r'(?P<video_url>rtsp://[^"]*.mp4)' RTSP_STREAM = r'(?P<video_url>rtsp://[^"]*.mp4)'
mobj = re.search(self._MEDIA_STREAM, media_link) mobj = re.search(self._MEDIA_STREAM, media_link)