mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 04:32:27 +03:00
[otomads] Add support
This commit is contained in:
parent
61d9bf124e
commit
ba763828af
@ -59,6 +59,7 @@ SITES = {
|
||||
'naver' : 'naver',
|
||||
'7gogo' : 'nanagogo',
|
||||
'nicovideo' : 'nicovideo',
|
||||
'otomads' : 'otomads',
|
||||
'panda' : 'panda',
|
||||
'pinterest' : 'pinterest',
|
||||
'pixnet' : 'pixnet',
|
||||
|
@ -51,6 +51,7 @@ from .nanagogo import *
|
||||
from .naver import *
|
||||
from .netease import *
|
||||
from .nicovideo import *
|
||||
from .otomads import *
|
||||
from .panda import *
|
||||
from .pinterest import *
|
||||
from .pixnet import *
|
||||
|
28
src/you_get/extractors/otomads.py
Normal file
28
src/you_get/extractors/otomads.py
Normal file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['otomads_download']
|
||||
|
||||
from ..common import *
|
||||
import json
|
||||
|
||||
def otomads_download(url, output_dir = '.', merge = False, info_only = False, **kwargs):
|
||||
vid = match1(url, r"http://otomads.com/om(\d+)")
|
||||
interface_url = "https://otomads.com/api/?type=get_video_info&id={vid}".format(vid = vid)
|
||||
rawjson = get_content(interface_url)
|
||||
jsonobj = json.loads(rawjson)
|
||||
if 'title' in kwargs and kwargs['title']:
|
||||
title = kwargs['title']
|
||||
else:
|
||||
title = jsonobj['title']
|
||||
url = jsonobj['url']
|
||||
type_ = ''
|
||||
size = 0
|
||||
_, type_, temp = url_info(url)
|
||||
size += temp
|
||||
print_info(site_info, title, type_, size)
|
||||
if not info_only:
|
||||
download_urls([url], title, type_, total_size = None, output_dir = output_dir, merge = merge)
|
||||
|
||||
site_info = "otomads.com"
|
||||
download = otomads_download
|
||||
download_playlist = playlist_not_supported("otomads")
|
Loading…
Reference in New Issue
Block a user