From ff7adf5bc4ed28fda434685c705d9ac59afbfab5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 11 Jan 2013 04:43:30 +0100 Subject: [PATCH] add support for NetEase, fix #59 --- README.md | 2 ++ README.txt | 1 + you_get/downloader/__init__.py | 1 + you_get/downloader/netease.py | 38 ++++++++++++++++++++++++++++++++++ you_get/downloader/qq.py | 2 +- you_get/main.py | 1 + 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 you_get/downloader/netease.py diff --git a/README.md b/README.md index 2d976e56..122b711e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Fork me on GitHub: * ifeng (凤凰视频) * iQIYI (爱奇艺) * Ku6 (酷6网) +* NetEase (网易) * PPTV * QQ (腾讯视频) * Sina (新浪视频) @@ -216,6 +217,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y * 凤凰视频 * 爱奇艺 * 酷6网 +* 网易 * PPTV * 腾讯视频 * 新浪视频 diff --git a/README.txt b/README.txt index 5c3a1da2..4c7a3b52 100644 --- a/README.txt +++ b/README.txt @@ -28,6 +28,7 @@ Supported Sites (As of Now) * ifeng (凤凰视频) http://v.ifeng.com * iQIYI (爱奇艺) http://www.iqiyi.com * Ku6 (酷6网) http://www.ku6.com +* NetEase (网易) http://v.163.com * PPTV http://www.pptv.com * QQ (腾讯视频) http://v.qq.com * Sina (新浪视频) http://video.sina.com.cn diff --git a/you_get/downloader/__init__.py b/you_get/downloader/__init__.py index 02cf7524..71d32301 100644 --- a/you_get/downloader/__init__.py +++ b/you_get/downloader/__init__.py @@ -8,6 +8,7 @@ from .googleplus import * from .ifeng import * from .iqiyi import * from .ku6 import * +from .netease import * from .pptv import * from .qq import * from .sina import * diff --git a/you_get/downloader/netease.py b/you_get/downloader/netease.py new file mode 100644 index 00000000..cd1504fb --- /dev/null +++ b/you_get/downloader/netease.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +__all__ = ['netease_download'] + +from ..common import * + +def netease_download(url, output_dir = '.', merge = True, info_only = False): + html = get_decoded_html(url) + + src = r1(r' sd_size: + url, size = hd_url, hd_size + else: + url, size = sd_url, sd_size + ext = 'flv' + + else: + title = r1('(.+)', html) + url = r1(r'(.+)-list.m3u8', src) + ".mp4" + _, _, size = url_info(url) + ext = 'mp4' + + print_info(site_info, title, ext, size) + if not info_only: + download_urls([url], title, ext, size, output_dir = output_dir, merge = merge) + +site_info = "163.com" +download = netease_download +download_playlist = playlist_not_supported('netease') diff --git a/you_get/downloader/qq.py b/you_get/downloader/qq.py index cd0a53bc..da56ea12 100644 --- a/you_get/downloader/qq.py +++ b/you_get/downloader/qq.py @@ -30,6 +30,6 @@ def qq_download(url, output_dir = '.', merge = True, info_only = False): qq_download_by_id(id, title, output_dir = output_dir, merge = merge, info_only = info_only) -site_info = "V.QQ.com" +site_info = "QQ.com" download = qq_download download_playlist = playlist_not_supported('qq') diff --git a/you_get/main.py b/you_get/main.py index 48b4b202..0844e7ab 100644 --- a/you_get/main.py +++ b/you_get/main.py @@ -18,6 +18,7 @@ def url_to_module(url): k = r1(r'([^.]+)', domain) downloads = { + '163': netease, '56': w56, 'acfun': acfun, 'bilibili': bilibili,