X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fphotobucket.py;h=b4389e0b6feaf0726a4805bec674b77cd38e295b;hb=9e1a5b845586a0a5431fb72467142046d8571e6f;hp=a5995349773c2f631d5d9347cd9f955e9681d65c;hpb=e712d94adfa6fb9c18c6d7317510086e7b69969b;p=youtube-dl diff --git a/youtube_dl/extractor/photobucket.py b/youtube_dl/extractor/photobucket.py index a59953497..b4389e0b6 100644 --- a/youtube_dl/extractor/photobucket.py +++ b/youtube_dl/extractor/photobucket.py @@ -1,10 +1,10 @@ from __future__ import unicode_literals -import datetime import json import re from .common import InfoExtractor +from ..utils import compat_urllib_parse class PhotobucketIE(InfoExtractor): @@ -14,6 +14,7 @@ class PhotobucketIE(InfoExtractor): 'file': 'zpsc0c3b9fa.mp4', 'md5': '7dabfb92b0a31f6c16cebc0f8e60ff99', 'info_dict': { + 'timestamp': 1367669341, 'upload_date': '20130504', 'uploader': 'rachaneronas', 'title': 'Tired of Link Building? Try BacklinkMyDomain.com!', @@ -30,13 +31,14 @@ class PhotobucketIE(InfoExtractor): # Extract URL, uploader, and title from webpage self.report_extraction(video_id) 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) + url = compat_urllib_parse.unquote(self._html_search_regex(r'file=(.+\.mp4)', info['linkcodes']['html'], 'url')) return { 'id': video_id, - 'url': info['downloadUrl'], + 'url': url, 'uploader': info['username'], - 'upload_date': datetime.date.fromtimestamp(info['creationDate']).strftime('%Y%m%d'), + 'timestamp': info['creationDate'], 'title': info['title'], 'ext': video_extension, 'thumbnail': info['thumbUrl'],