1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-17 15:55:56 +00:00

test_download works for photobucket after this change

This commit is contained in:
codesparkle 2014-05-17 01:43:03 +10:00
parent 05ee2b6dad
commit a725fb1f43

View file

@ -1,10 +1,10 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import datetime
import json import json
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from utils import compat_urllib_parse
class PhotobucketIE(InfoExtractor): class PhotobucketIE(InfoExtractor):
@ -14,6 +14,7 @@ class PhotobucketIE(InfoExtractor):
'file': 'zpsc0c3b9fa.mp4', 'file': 'zpsc0c3b9fa.mp4',
'md5': '7dabfb92b0a31f6c16cebc0f8e60ff99', 'md5': '7dabfb92b0a31f6c16cebc0f8e60ff99',
'info_dict': { 'info_dict': {
'timestamp': 1367669341,
'upload_date': '20130504', 'upload_date': '20130504',
'uploader': 'rachaneronas', 'uploader': 'rachaneronas',
'title': 'Tired of Link Building? Try BacklinkMyDomain.com!', 'title': 'Tired of Link Building? Try BacklinkMyDomain.com!',
@ -32,11 +33,12 @@ class PhotobucketIE(InfoExtractor):
info_json = self._search_regex(r'Pb\.Data\.Shared\.put\(Pb\.Data\.Shared\.MEDIA, (.*?)\);', info_json = self._search_regex(r'Pb\.Data\.Shared\.put\(Pb\.Data\.Shared\.MEDIA, (.*?)\);',
webpage, 'info json') webpage, 'info json')
info = json.loads(info_json) info = json.loads(info_json)
url = compat_urllib_parse.unquote(self._html_search_regex('file=(.+\.mp4)', info['linkcodes']['html'], 'url'))
return { return {
'id': video_id, 'id': video_id,
'url': info['downloadUrl'], 'url': url,
'uploader': info['username'], 'uploader': info['username'],
'upload_date': datetime.date.fromtimestamp(info['creationDate']).strftime('%Y%m%d'), 'timestamp': info['creationDate'],
'title': info['title'], 'title': info['title'],
'ext': video_extension, 'ext': video_extension,
'thumbnail': info['thumbUrl'], 'thumbnail': info['thumbUrl'],