From 60b6834e547e328b1dee86dc748689292beba0e8 Mon Sep 17 00:00:00 2001 From: Valdemar Erk Date: Tue, 3 Jan 2017 23:58:56 +0100 Subject: [PATCH] Quanmin support. --- README.md | 1 + src/you_get/common.py | 1 + src/you_get/extractors/quanmin.py | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 src/you_get/extractors/quanmin.py diff --git a/README.md b/README.md index 40a26803..98c403c3 100644 --- a/README.md +++ b/README.md @@ -408,6 +408,7 @@ Use `--url`/`-u` to get a list of downloadable resource URLs extracted from the | Naver
네이버 | |✓| | | | 芒果TV | |✓| | | | 火猫TV | |✓| | | +| 全民Tv | |✓| | | For all other sites not on the list, the universal extractor will take care of finding and downloading interesting resources from the page. diff --git a/src/you_get/common.py b/src/you_get/common.py index 7db4fba2..f320f6ab 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -65,6 +65,7 @@ SITES = { 'pptv' : 'pptv', 'qianmo' : 'qianmo', 'qq' : 'qq', + 'quanmin' : 'quanmin', 'showroom-live' : 'showroom', 'sina' : 'sina', 'smgbb' : 'bilibili', diff --git a/src/you_get/extractors/quanmin.py b/src/you_get/extractors/quanmin.py new file mode 100644 index 00000000..99e8790c --- /dev/null +++ b/src/you_get/extractors/quanmin.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +__all__ = ['quanmin_download'] + +from ..common import * +import json +import time + +def quanmin_download(url, output_dir = '.', merge = True, info_only = False, **kwargs): + roomid = url[url.rfind("/")+1:] + json_request_url = 'http://www.quanmin.tv/json/rooms/{}/info4.json'.format(roomid) + + content = get_html(json_request_url) + data = json.loads(content) + + title = data["title"] + real_url = "http://flv.quanmin.tv/live/{}.flv".format(roomid) + + print_info(site_info, title, 'flv', float('inf')) + if not info_only: + download_urls([real_url], title, 'flv', None, output_dir, merge = merge) + +site_info = "quanmin.tv" +download = quanmin_download +download_playlist = playlist_not_supported('quanmin')