mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 03:37:52 +03:00
[flickr] new site support
This commit is contained in:
parent
b16cd48610
commit
8fa57ef85b
@ -15,6 +15,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
|||||||
### Supported Sites
|
### Supported Sites
|
||||||
|
|
||||||
* Dailymotion <http://dailymotion.com>
|
* Dailymotion <http://dailymotion.com>
|
||||||
|
* Flickr <http://www.flickr.com>
|
||||||
* Freesound <http://www.freesound.org>
|
* Freesound <http://www.freesound.org>
|
||||||
* Google+ <http://plus.google.com>
|
* Google+ <http://plus.google.com>
|
||||||
* Instagram <http://instagram.com>
|
* Instagram <http://instagram.com>
|
||||||
|
@ -991,6 +991,7 @@ def url_to_module(url):
|
|||||||
douyutv,
|
douyutv,
|
||||||
ehow,
|
ehow,
|
||||||
facebook,
|
facebook,
|
||||||
|
flickr,
|
||||||
freesound,
|
freesound,
|
||||||
funshion,
|
funshion,
|
||||||
google,
|
google,
|
||||||
@ -1071,6 +1072,7 @@ def url_to_module(url):
|
|||||||
'douyutv': douyutv,
|
'douyutv': douyutv,
|
||||||
'ehow': ehow,
|
'ehow': ehow,
|
||||||
'facebook': facebook,
|
'facebook': facebook,
|
||||||
|
'flickr': flickr,
|
||||||
'freesound': freesound,
|
'freesound': freesound,
|
||||||
'fun': funshion,
|
'fun': funshion,
|
||||||
'google': google,
|
'google': google,
|
||||||
|
@ -15,6 +15,7 @@ from .douban import *
|
|||||||
from .douyutv import *
|
from .douyutv import *
|
||||||
from .ehow import *
|
from .ehow import *
|
||||||
from .facebook import *
|
from .facebook import *
|
||||||
|
from .flickr import *
|
||||||
from .freesound import *
|
from .freesound import *
|
||||||
from .funshion import *
|
from .funshion import *
|
||||||
from .google import *
|
from .google import *
|
||||||
|
29
src/you_get/extractors/flickr.py
Normal file
29
src/you_get/extractors/flickr.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['flickr_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def flickr_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||||
|
html = get_html(url)
|
||||||
|
title = match1(html, r'<meta property="og:title" content="([^"]*)"')
|
||||||
|
photo_id = match1(html, r'"id":"([0-9]+)"')
|
||||||
|
|
||||||
|
html = get_html('https://secure.flickr.com/apps/video/video_mtl_xml.gne?photo_id=%s' % photo_id)
|
||||||
|
node_id = match1(html, r'<Item id="id">(.+)</Item>')
|
||||||
|
secret = match1(html, r'<Item id="photo_secret">(.+)</Item>')
|
||||||
|
|
||||||
|
html = get_html('https://secure.flickr.com/video_playlist.gne?node_id=%s&secret=%s' % (node_id, secret))
|
||||||
|
app = match1(html, r'APP="([^"]+)"')
|
||||||
|
fullpath = unescape_html(match1(html, r'FULLPATH="([^"]+)"'))
|
||||||
|
url = app + fullpath
|
||||||
|
|
||||||
|
mime, ext, size = url_info(url)
|
||||||
|
|
||||||
|
print_info(site_info, title, mime, size)
|
||||||
|
if not info_only:
|
||||||
|
download_urls([url], title, ext, size, output_dir, merge=merge, faker=True)
|
||||||
|
|
||||||
|
site_info = "Flickr.com"
|
||||||
|
download = flickr_download
|
||||||
|
download_playlist = playlist_not_supported('flickr')
|
Loading…
Reference in New Issue
Block a user