X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fgoogleplus.py;h=ab12d7e9381317b4dfddb679eced39db2f752ed4;hb=16f36a6fc92d6ab89293e45de65475455fbc1b47;hp=e922bd1405d57ba0c074af48f0192b90cf0eb5ef;hpb=7aca14a1ec9d92599b8871540cfde2dc8225eb8d;p=youtube-dl.git diff --git a/youtube_dl/extractor/googleplus.py b/youtube_dl/extractor/googleplus.py index e922bd140..ab12d7e93 100644 --- a/youtube_dl/extractor/googleplus.py +++ b/youtube_dl/extractor/googleplus.py @@ -1,3 +1,5 @@ +# coding: utf-8 + import datetime import re @@ -8,10 +10,18 @@ from ..utils import ( class GooglePlusIE(InfoExtractor): - """Information extractor for plus.google.com.""" - + IE_DESC = u'Google Plus' _VALID_URL = r'(?:https://)?plus\.google\.com/(?:[^/]+/)*?posts/(\w+)' IE_NAME = u'plus.google' + _TEST = { + u"url": u"https://plus.google.com/u/0/108897254135232129896/posts/ZButuJc6CtH", + u"file": u"ZButuJc6CtH.flv", + u"info_dict": { + u"upload_date": u"20120613", + u"uploader": u"井上ヨシマサ", + u"title": u"嘆きの天使 降臨" + } + } def _real_extract(self, url): # Extract id from URL @@ -30,7 +40,9 @@ class GooglePlusIE(InfoExtractor): self.report_extraction(video_id) # Extract update date - upload_date = self._html_search_regex('title="Timestamp">(.*?)', + upload_date = self._html_search_regex( + r'''(?x) + ([0-9]{4}-[0-9]{2}-[0-9]{2})''', webpage, u'upload date', fatal=False) if upload_date: # Convert timestring to a format suitable for filename @@ -46,14 +58,18 @@ class GooglePlusIE(InfoExtractor): video_title = self._html_search_regex(r'