-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
853 additions
and
1,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6f950d4432087aab00f1b0eb54b6a958 addons.xml | ||
6f1710fee0aa7e01cd890dba04021db5 addons.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf8" standalone="yes"?> | ||
<?xml version="1.0" encoding="utf8" standalone="yes"?> | ||
<settings> | ||
<setting id="movie_res" type="enum" label="最高播放清晰度" values="低分辨率(标清)|中分辨率(高清)|高分辨率(超清)" default="2"/> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
#!/usr/bin/env python | ||
|
||
import re | ||
from xml.dom.minidom import parseString | ||
from json import loads | ||
from common import get_html, r1 | ||
|
||
|
||
HOST_URL = 'http://www.tudou.com' | ||
from common import get_html, match1, r1 | ||
|
||
class Tudou(): | ||
def video_from_iid(self, iid, **kwargs): | ||
url = 'http://www.tudou.com/outplay/goto/getItemSegs.action?iid=%s' | ||
html = get_html(url % iid) | ||
data = loads(html) | ||
|
||
keys = data.keys() | ||
|
||
for key in keys: | ||
if data[key][0].get('size'): | ||
vids = [t['k'] for t in data[key]] | ||
break | ||
def tudou_download_by_iid(self, iid, title, **kwargs): | ||
data = loads(get_html('http://www.tudou.com/outplay/goto/getItemSegs.action?iid=%s' % iid)) | ||
temp = max([data[i] for i in data if 'size' in data[i][0]], key=lambda x:sum([part['size'] for part in x])) | ||
vids, size = [t["k"] for t in temp], sum([t["size"] for t in temp]) | ||
|
||
urls = [] | ||
for vid in vids: | ||
html = get_html('http://cnc.v2.tudou.com/f?id=%d&jp=1' % vid) | ||
y = re.compile('<f.+?>(http.+?)<\/f>').findall(html) | ||
if len(y) < 1: | ||
break | ||
y = y[0].replace('&', '&') | ||
urls.append(y.strip()) | ||
for i in parseString(get_html('http://ct.v2.tudou.com/f?id=%s' % vid)).getElementsByTagName('f'): | ||
urls.append(i.firstChild.nodeValue.strip()) | ||
|
||
return urls | ||
|
||
def video_from_id(self, id, **kwargs): | ||
def tudou_download_by_id(self, id, title, **kwargs): | ||
html = get_html('http://www.tudou.com/programs/view/%s/' % id) | ||
|
||
iid = r1(r'iid\s*[:=]\s*(\S+)', html) | ||
return self.video_from_iid(iid, **kwargs) | ||
|
||
def parse_plist(url): | ||
html = get_html(url) | ||
lcode = r1(r"lcode:\s*'([^']+)'", html) | ||
plist_info = loads(get_html('http://www.tudou.com/crp/plist.action?lcode=' + lcode)) | ||
return ([(item['kw'], item['iid']) for item in plist_info['items']]) | ||
|
||
def download_playlist(self, url, **kwargs): | ||
videos = parse_plist(url) | ||
urls = [] | ||
for i, (title, id) in enumerate(videos): | ||
print('Processing %s of %s videos...' % (i + 1, len(videos))) | ||
urls += self.video_from_iid(id) | ||
try: | ||
title = r1(r'kw\s*[:=]\s*[\'\"]([^\n]+?)\'\s*\n', html).replace("\\'", "\'") | ||
except AttributeError: | ||
title = '' | ||
return self.tudou_download_by_iid(iid, title, **kwargs) | ||
|
||
def video_from_url(self, url, **kwargs): | ||
# Embedded player | ||
id = r1(r'http://www.tudou.com/v/([^/]+)/', url) | ||
id = r1(r'.tudou.com/v/([^/]+)/', url) | ||
if id: | ||
return self.video_from_id(id, **kwargs) | ||
|
||
return self.tudou_download_by_id(id, title='') | ||
html = get_html(url) | ||
|
||
try: | ||
title = r1(r'\Wkw\s*[:=]\s*[\'\"]([^\n]+?)\'\s*\n', html).replace("\\'", "\'") | ||
assert title | ||
title = unescape_html(title) | ||
except AttributeError: | ||
title = match1(html, r'id=\"subtitle\"\s*title\s*=\s*\"([^\"]+)\"') | ||
if title is None: | ||
title = '' | ||
|
||
vcode = r1(r'vcode\s*[:=]\s*\'([^\']+)\'', html) | ||
if vcode is None: | ||
vcode = match1(html, r'viden\s*[:=]\s*\"([\w+/=]+)\"') | ||
if vcode: | ||
from youku import video_from_vid | ||
return video_from_vid(vcode, **kwargs) | ||
|
||
print "vcode", vcode | ||
from youku import Youku | ||
return Youku().video_from_vid(vcode, **kwargs) | ||
|
||
iid = r1(r'iid\s*[:=]\s*(\d+)', html) | ||
if not iid: | ||
return self.download_playlist(url) | ||
return self.tudou_download_playlist(url, **kwargs) | ||
else: | ||
return self.video_from_iid(iid, **kwargs) | ||
return self.tudou_download_by_iid(iid, title, **kwargs) | ||
|
||
def parse_plist(self, url): | ||
html = get_html(url) | ||
lcode = r1(r"lcode:\s*'([^']+)'", html) | ||
plist_info = loads(get_html('http://www.tudou.com/crp/plist.action?lcode=' + lcode)) | ||
return ([(item['kw'], item['iid']) for item in plist_info['items']]) | ||
|
||
def tudou_download_playlist(url, **kwargs): | ||
videos = self.parse_plist(url) | ||
for i, (title, id) in enumerate(videos): | ||
print('Processing %s of %s videos...' % (i + 1, len(videos))) | ||
self.tudou_download_by_iid(id, title, **kwargs) | ||
|
||
site = Tudou() | ||
video_from_iid = site.video_from_iid | ||
video_from_url = site.video_from_url | ||
|
||
#print video_from_url('http://video.tudou.com/v/XMzE3OTYyNjE0MA==.html?spm=a2h28.8313471.pl.dlink_1_21') |
Binary file renamed
BIN
+75.5 KB
...v-video/plugin.video.cntv-video-1.0.8.zip → ...v-video/plugin.video.cntv-video-1.0.9.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf8" standalone="yes"?> | ||
<settings> | ||
<setting id="resolution" type="enum" label="点播视频清晰度" values="每次询问|4K|1080P|720P|超清|标清|流畅|极速" default="0"/> | ||
</settings> | ||
<?xml version="1.0" encoding="utf8" standalone="yes"?> | ||
<settings> | ||
<setting id="resolution" type="enum" label="点播视频清晰度" values="每次询问|4K|1080P|720P|超清|标清|流畅|极速" default="0"/> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<setting id="video_resolution" type="enum" label="30200" lvalues="30300|30301|30302" default="1"/> | ||
<setting id="video_server" type="enum" label="30205" lvalues="30310|30311|30312|30313" default="0"/> | ||
<setting id="video_cfragmentmax" type="enum" label="30203" values="10|15|20|25|30|35|40|45|50|60|70|80|90|100|200|300|400|500" default="4"/> | ||
<setting id="video_fragmentstart" type="enum" label="30204" values="1|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" default="0"/> | ||
<setting id="video_vplaycont" type="bool" label="30201" default="true"/> | ||
<setting id="video_m3u8" type="bool" label="30206" default="true"/> | ||
<setting id="http_proxy" type="text" label="30202" values="" default=""/> | ||
</settings> | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<setting id="video_resolution" type="enum" label="30200" lvalues="30300|30301|30302" default="1"/> | ||
<setting id="video_server" type="enum" label="30205" lvalues="30310|30311|30312|30313" default="0"/> | ||
<setting id="video_cfragmentmax" type="enum" label="30203" values="10|15|20|25|30|35|40|45|50|60|70|80|90|100|200|300|400|500" default="4"/> | ||
<setting id="video_fragmentstart" type="enum" label="30204" values="1|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" default="0"/> | ||
<setting id="video_vplaycont" type="bool" label="30201" default="true"/> | ||
<setting id="video_m3u8" type="bool" label="30206" default="true"/> | ||
<setting id="http_proxy" type="text" label="30202" values="" default=""/> | ||
</settings> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<category label="normal"> | ||
<setting id="page_rows" type="slider" label="30000" default="20" range="12,4,100" option="int"/> | ||
<setting id="quality" type="labelenum" label="30001" values="super|high|low|max" lvalues="30003|30004|30005|30006" default="super"/> | ||
<setting id="auto_next" type="bool" label="30007" default="true"/> | ||
<setting id="expired_time" type="text" label="expiredTime" visible="false"/> | ||
</category> | ||
<category label="extra"> | ||
<setting id="handle_redirect" type="bool" label="30008" default="true"/> | ||
</category> | ||
</settings> | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<category label="normal"> | ||
<setting id="page_rows" type="slider" label="30000" default="20" range="12,4,100" option="int"/> | ||
<setting id="quality" type="labelenum" label="30001" values="super|high|low|max" lvalues="30003|30004|30005|30006" default="super"/> | ||
<setting id="auto_next" type="bool" label="30007" default="true"/> | ||
<setting id="expired_time" type="text" label="expiredTime" visible="false"/> | ||
</category> | ||
<category label="extra"> | ||
<setting id="handle_redirect" type="bool" label="30008" default="true"/> | ||
</category> | ||
</settings> |
Oops, something went wrong.