diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-05-16 20:43:36 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-05-16 20:44:52 +0200 |
commit | 08af0205f974c4b6c1b01c0bc0200f90cce36c48 (patch) | |
tree | 833dc49249d75a3af8ddf8bfd80e48e2d30aee22 /youtube_dl/extractor | |
parent | 05ee2b6dad065e01ca454502d4516fb6853abad1 (diff) | |
parent | a725fb1f4329a436e32019645299c11fa080ed74 (diff) |
Merge remote-tracking branch 'codesparkle/fix-photobucket-url' (closes #2934)
Fix photobucket url extraction
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/photobucket.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dl/extractor/photobucket.py b/youtube_dl/extractor/photobucket.py index a59953497..8aa69c46e 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!', @@ -32,11 +33,12 @@ class PhotobucketIE(InfoExtractor): info_json = self._search_regex(r'Pb\.Data\.Shared\.put\(Pb\.Data\.Shared\.MEDIA, (.*?)\);', 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'], |