diff --git a/src/you_get/downloader/googleplus.py b/src/you_get/downloader/googleplus.py index fb386c39..e3e0e66b 100644 --- a/src/you_get/downloader/googleplus.py +++ b/src/you_get/downloader/googleplus.py @@ -47,12 +47,17 @@ def googleplus_download(url, output_dir = '.', merge = True, info_only = False): if real_url: break real_url = unicodize(real_url) - + type, ext, size = url_info(real_url) if not ext: ext = 'mp4' + response = request.urlopen(request.Request(real_url)) + if response.headers['content-disposition']: + filename = parse.unquote(r1(r'filename="?(.+)"?', response.headers['content-disposition'])).split('.') + title = ''.join(filename[:-1]) + print_info(site_info, title, ext, size) if not info_only: download_urls([real_url], title, ext, size, output_dir, merge = merge) diff --git a/tests/test.py b/tests/test.py index 76851123..f7544d7d 100644 --- a/tests/test.py +++ b/tests/test.py @@ -17,16 +17,6 @@ class YouGetTests(unittest.TestCase): "http://www.freesound.org/people/Corsica_S/sounds/184419/", ]) - def test_googleplus(self): - test_urls([ - "http://plus.google.com/102663035987142737445/posts/jJRu43KQFT5", - "http://plus.google.com/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/posts/jJRu43KQFT5", - "http://plus.google.com/+平田梨奈/posts/jJRu43KQFT5", - "http://plus.google.com/photos/102663035987142737445/albums/5844078581209509505/5844078587839097874", - "http://plus.google.com/photos/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/albums/5844078581209509505/5844078587839097874", - "http://plus.google.com/photos/+平田梨奈/albums/5844078581209509505/5844078587839097874", - ]) - def test_jpopsuki(self): test_urls([ "http://jpopsuki.tv/video/Dragon-Ash---Run-to-the-Sun/8ad7aec604badd0b0798cd999b63ae17",