mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
add support for Facebook, fix #74
This commit is contained in:
parent
898e1b63cf
commit
967457dc51
@ -13,6 +13,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
||||
* YouTube <http://www.youtube.com>
|
||||
* Vimeo <http://vimeo.com>
|
||||
* Dailymotion <http://dailymotion.com>
|
||||
* Facebook <http://facebook.com>
|
||||
* Google+ <http://plus.google.com>
|
||||
* Tumblr <http://www.tumblr.com>
|
||||
* SoundCloud <http://soundcloud.com>
|
||||
@ -205,6 +206,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
* YouTube <http://www.youtube.com>
|
||||
* Vimeo <http://vimeo.com>
|
||||
* Dailymotion <http://dailymotion.com>
|
||||
* Facebook <http://facebook.com>
|
||||
* Google+ <http://plus.google.com>
|
||||
* Tumblr <http://www.tumblr.com>
|
||||
* SoundCloud <http://soundcloud.com>
|
||||
|
@ -16,6 +16,7 @@ Supported Sites (As of Now)
|
||||
* YouTube http://www.youtube.com
|
||||
* Vimeo http://vimeo.com
|
||||
* Dailymotion http://dailymotion.com
|
||||
* Facebook http://facebook.com
|
||||
* Google+ http://plus.google.com
|
||||
* Tumblr http://www.tumblr.com
|
||||
* SoundCloud http://soundcloud.com
|
||||
|
@ -4,6 +4,7 @@ from .acfun import *
|
||||
from .bilibili import *
|
||||
from .cntv import *
|
||||
from .dailymotion import *
|
||||
from .facebook import *
|
||||
from .googleplus import *
|
||||
from .ifeng import *
|
||||
from .iqiyi import *
|
||||
|
25
you_get/downloader/facebook.py
Normal file
25
you_get/downloader/facebook.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['facebook_download']
|
||||
|
||||
from ..common import *
|
||||
|
||||
def facebook_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
html = get_html(url)
|
||||
|
||||
title = r1(r'<title id="pageTitle">(.+) \| Facebook</title>', html)
|
||||
|
||||
for fmt in ["hd_src", "sd_src"]:
|
||||
src = parse.unquote(unicodize(r1(r'\["' + fmt + '","([^"]*)', html)))
|
||||
if src:
|
||||
break
|
||||
|
||||
type, ext, size = url_info(src)
|
||||
|
||||
print_info(site_info, title, type, size)
|
||||
if not info_only:
|
||||
download_urls([src], title, ext, size, output_dir, merge = merge)
|
||||
|
||||
site_info = "Facebook.com"
|
||||
download = facebook_download
|
||||
download_playlist = playlist_not_supported('facebook')
|
@ -24,6 +24,7 @@ def url_to_module(url):
|
||||
'bilibili': bilibili,
|
||||
'cntv': cntv,
|
||||
'dailymotion': dailymotion,
|
||||
'facebook': facebook,
|
||||
'google': googleplus,
|
||||
'iask': sina,
|
||||
'ifeng': ifeng,
|
||||
|
Loading…
x
Reference in New Issue
Block a user