diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 10:16:22 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 10:16:22 +0100 |
commit | 42154ad5bcd2aa5606fc4afdc7deceadbf496b19 (patch) | |
tree | a18e0bbd43e2c006c82a78ebefd706a4a82f55a1 /youtube_dl/extractor/archiveorg.py | |
parent | 96f1b0741caa0356eb1ab1b2215d357f2f647840 (diff) |
[archiveorg] Use centralized sorting
Diffstat (limited to 'youtube_dl/extractor/archiveorg.py')
-rw-r--r-- | youtube_dl/extractor/archiveorg.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/youtube_dl/extractor/archiveorg.py b/youtube_dl/extractor/archiveorg.py index 497ce97ac..34ce8429b 100644 --- a/youtube_dl/extractor/archiveorg.py +++ b/youtube_dl/extractor/archiveorg.py @@ -5,7 +5,6 @@ import re from .common import InfoExtractor from ..utils import ( - determine_ext, unified_strdate, ) @@ -26,7 +25,6 @@ class ArchiveOrgIE(InfoExtractor): } } - def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') @@ -40,16 +38,16 @@ class ArchiveOrgIE(InfoExtractor): uploader = data['metadata']['creator'][0] upload_date = unified_strdate(data['metadata']['date'][0]) - formats = [{ + formats = [ + { 'format': fdata['format'], 'url': 'http://' + data['server'] + data['dir'] + fn, 'file_size': int(fdata['size']), } - for fn,fdata in data['files'].items() + for fn, fdata in data['files'].items() if 'Video' in fdata['format']] - formats.sort(key=lambda fdata: fdata['file_size']) - for f in formats: - f['ext'] = determine_ext(f['url']) + + self._sort_formats(formats) return { '_type': 'video', |