Permalink
Browse files

Google+: default to download the best quality & codecs; fix #42 and #43

  • Loading branch information...
1 parent 9028df6 commit a681458860188dee13266ba96df50e6f8b97a1ae @soimort committed Dec 17, 2012
Showing with 40 additions and 6 deletions.
  1. +9 −0 CHANGELOG.txt
  2. +29 −4 you_get/downloader/googleplus.py
  3. +2 −2 you_get/version.py
View
@@ -1,6 +1,15 @@
Changelog
=========
+0.3dev-20121217
+---------------
+
+*Date: 2012-12-17*
+
+* Google+: downloading the highest available quality now.
+* Fix issues `#42 <https://github.com/soimort/you-get/issues/42>`_, `#43 <https://github.com/soimort/you-get/issues/43>`_ for Google+.
+* Merge pull request `#40 <https://github.com/soimort/you-get/pull/40>`_; fix some issues for Ku6, Sina and 56.
+
0.3dev-20121212
---------------
@@ -4,20 +4,45 @@
from ..common import *
+import re
+
def googleplus_download(url, output_dir = '.', merge = True, info_only = False):
# Percent-encoding Unicode URL
- url = parse.quote(url, safe = ':/')
+ url = parse.quote(url, safe = ':/+%')
html = get_html(url)
html = parse.unquote(html).replace('\/', '/')
title = r1(r'<title>(.*)</title>', html) or r1(r'<title>(.*)\n', html)
url2 = r1(r'"(https\://plus\.google\.com/photos/.*?)",,"image/jpeg","video"\]', html)
- html2 = get_html(url2)
- html2 = parse.unquote(html2.replace('\/', '/'))
+ if url2:
+ html = get_html(url2)
+ html = parse.unquote(html.replace('\/', '/'))
+
+ url_data = re.findall(r'(\[[^\[\"]+\"http://redirector.googlevideo.com/.*\"\])', html)
- real_url = r1(r',\"(http://redirector.googlevideo.com/.*)\"]', html2)
+ for itag in [
+ '38',
+ '46', '37',
+ '102', '45', '22',
+ '84',
+ '120',
+ '85',
+ '44', '35',
+ '101', '100', '43', '34', '82', '18',
+ '6',
+ '83', '5', '36',
+ '17',
+ '13',
+ ]:
+ real_url = None
+ for url_item in url_data:
+ if itag == str(eval(url_item)[0]):
+ real_url = eval(url_item)[3]
+ break
+ if real_url:
+ break
real_url = unicodize(real_url)
type, ext, size = url_info(real_url)
View
@@ -1,4 +1,4 @@
#!/usr/bin/env python
-__version__ = '0.3dev-20121212'
-__date__ = '2012-12-12'
+__version__ = '0.3dev-20121217'
+__date__ = '2012-12-17'

0 comments on commit a681458

Please sign in to comment.