Skip to content

Commit

Permalink
full series list in youku
Browse files Browse the repository at this point in the history
  • Loading branch information
yfang1644 committed Apr 12, 2020
1 parent 2d44f1e commit f804ebc
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 82 deletions.
6 changes: 3 additions & 3 deletions addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@

<addon id="plugin.video.meiju"
name="美剧"
version="1.0.0"
version="1.0.2"
provider-name="yfang1644">
<requires>
<import addon="script.module.xbmcswift2" version="2.4.0"/>
Expand Down Expand Up @@ -531,7 +531,7 @@

<addon id="plugin.video.youku"
name="优酷视频"
version="2.0.3"
version="2.0.4"
provider-name="yfang1644">
<requires>
<import addon="script.module.geturl" version="2.0.0"/>
Expand Down Expand Up @@ -854,7 +854,7 @@
<addon id="script.module.geturl"
name="CHVideo getURL"
provider-name="yfang1644"
version="2.0.0">
version="2.0.1">
<requires>
<import addon="xbmc.python" version="2.24.0" />
</requires>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
684fb49b798b75b91afb7c96f6511e3f addons.xml
8d6bccd735b3457fb3ea297939bb8c86 addons.xml
1 change: 0 additions & 1 deletion plugin.video.bilivideo/lib/bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ def get_video_urls(self, cid, qn=0):
chksum = hashlib.md5(compact_bytes(params_str + SECRETKEY, 'utf-8')).hexdigest()

purl = '{}?{}&sign={}'.format(api_url, params_str, chksum)
print "XXXXXXXXXXXXXXXXX",purl
html = get_html(purl)

m = hashlib.md5()
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.meiju/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.meiju"
name="美剧"
version="1.0.0"
version="1.0.2"
provider-name="yfang1644">
<requires>
<import addon="script.module.xbmcswift2" version="2.4.0"/>
Expand All @@ -13,7 +13,7 @@
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en">meijumao video plugin</summary>
<summary lang="en">meiju video plugin</summary>
<summary lang="zh">搜罗网络美剧</summary>
<description lang="en">online video from yyetss(not yyets) and ttkmj, etc</description>
<description lang="zh">网上美剧视频</description>
Expand Down
195 changes: 148 additions & 47 deletions plugin.video.meiju/default.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
# -*- coding: utf-8 -*-

from xbmcswift2 import Plugin, ListItem, xbmc
from xbmcswift2 import Plugin, ListItem, xbmcgui
from bs4 import BeautifulSoup
import re
from common import get_html, r1
from json import loads
import time

YYETSS = 'http://www.yyetss.com/'
TTKMJ = 'https://www.ttkmj.org/'
MEIJUXIA = 'http://www.meijuxia.vip'
BANNER = '[COLOR FFDEB887]{}[/COLOR]'

plugin = Plugin()
Expand All @@ -16,6 +20,94 @@
def stay():
pass




@plugin.route('/xiaplay/<url>/')
def xiaplay(url):
html = get_html(url)
m = r1('cms_player\s*=\s*({.+?\});', html)
urlinfo = loads(m)
u = urlinfo['url']
print "XXXXXXXXXXXXXXXXXXX",u
t = int(time.time())
#u = re.sub('sign=\d+', 'sign='+str(t), u)
playurl = urlinfo['jiexi'] + u
playurl = get_html(playurl)
print playurl.encode('utf-8')

print "XXXXXXXXXXXXXXXXXX", playurl+'?t='+t
plugin.set_resolved_url(playurl + '?t=' + t)


@plugin.route('/xiafilter/<url>/')
def xiafilter(url):
html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')


@plugin.route('/xiaepisode/<url>/')
def xiaepisode(url):
plugin.set_content('TVShows')
html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')
tree = soup.findAll('div', {'class': 'tab-content'})
items = []

lists = tree[0].findAll('li')
for item in lists:
items.append({
'label': item.text,
'path': url_for('xiaplay', url=MEIJUXIA+item.a['href']),
'is_playable': True,
'info': {'title': item.text}
})
return items


@plugin.route('/xiacatagory/<url>/')
def xiacatagory(url=None):
if url is None:
url = MEIJUXIA + '/list-select-id-2-type--area--year--star--state--order-addtime.html'
items = []

items.append({
'label': '[COLOR yellow] 分类过滤[/COLOR]]',
'path': url_for('xiafilter', url=url)
})

plugin.set_content('TVShows')
html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')
tree = soup.findAll('ul', {'class': 'list-unstyled'})

lists = tree[0].findAll('li')
for item in lists:
url = MEIJUXIA + item.a['href']
title = item.img['alt']
info = item.span.text
info = info.replace('\n', '')
info = info.replace('\t', '')
info = info.replace(' ', '')
items.append({
'label': title + '('+ info + ')',
'path': url_for('xiaepisode', url=url),
'thumbnail': item.img['data-original'],
})

pages = soup.findAll('a', {'class': 'page-link'})
for page in pages:
items.append({
'label': page.text,
'path': url_for('xiacatagory', url=MEIJUXIA + page['href'])
})
return items


@plugin.route('/meijuxia/')
def meijuxia():
return xiacatagory(None)

@plugin.route('/ttepisodes/<url>/')
def ttepisodes(url):
plugin.set_content('TVShows')
Expand Down Expand Up @@ -161,37 +253,56 @@ def yyepisodes(url):
return items


@plugin.route('/yycategory/<url>/')
def yycategory(url):
plugin.set_content('TVShows')
@plugin.route('/yyfilter/<url>/')
def yyfilter(url):
dialog = xbmcgui.Dialog()

html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')

tree = soup.findAll('ul', {'class': 'navbar-nav'})
titles = tree[0].findAll('li')
lst = [x.text for x in titles[2:-1]]
sel = dialog.select('分类', lst)
sel = max(0, sel)
href = titles[2+sel].a['href']
hs = href.split('-')
cate = hs[1]

tree = soup.findAll('ul', {'class':'list-inline'})
years = tree[0].findAll('li')
titles = tree[0].findAll('li')
lst = [x.text for x in titles[1:]]
sel = dialog.select('年份', lst)
sel = max(0, sel)
href = titles[1+sel].a['href']
hs = href.split('-')
year = hs[2]
return yycategory(cate, year, 1)


@plugin.route('/yycategory/<cate>/<year>/<page>/')
def yycategory(cate, year, page):
plugin.set_content('TVShows')
items = []

# 年份
items.append({
'label': BANNER.format('年份'),
'path': url_for('stay')
})
for item in years[1:]:
title = item.text
try:
href = item.a['href']
except:
href = url
if href[0] == '/': href = YYETSS + href
items.append({
'label': title,
'path': url_for('yycategory', url=href)
})

# 剧集
url = YYETSS + 'list-{}-{}-{}.html'.format(cate, year, page)
html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')

tree = soup.findAll('ul', {'class': 'navbar-nav'})
titles = tree[0].findAll('li')
cname = ''
for x in titles[2:-1]:
if cate in x.a['href']:
cname = x.text.encode('utf-8')
break

items.append({
'label': BANNER.format('剧集'),
'path': url_for('stay')
'label': '分类 [COLOR yellow][{}-{}][/COLOR]'.format(cname, year),
'path': url_for('yyfilter', url=url)
})


tree = soup.findAll('div', {'class':'c-list-box'})
for item in tree:
title = item.a['title']
Expand All @@ -207,37 +318,23 @@ def yycategory(url):
'thumbnail': img
})

tree = soup.findAll('ul', {'class':'pagination'})
if not tree:
return items
# 分页
items.append({
'label': BANNER.format('分页'),
'path': url_for('stay')
})
tree = soup.findAll('ul', {'class':'pagination'})
pages = tree[0].findAll('li')
for item in pages:
title = item.text
href = item.a['href']
page = r1('-(\d+).html', href)
if href[0] == '/': href = YYETSS + href
items.append({
'label': title,
'path': url_for('yycategory', url=href)
})

return items


@plugin.route('/yyetss/')
def yyetss():
html = get_html(YYETSS)
soup = BeautifulSoup(html, 'html.parser')
tree = soup.findAll('li')
items = []
for item in tree[2:-2]:
url = item.a['href']
if url[0] == '/': url = YYETSS + url
items.append({
'label': item.text,
'path': url_for('yycategory', url=url)
'path': url_for('yycategory', cate=cate, year=year, page=page)
})

return items
Expand All @@ -248,13 +345,17 @@ def yyetss():
def index():
yield {
'label': '人人影视',
'path': url_for('yyetss')
'path': url_for('yycategory', cate='lishi', year='all', page=1)
}

yield {
'label': '天天看美剧',
'path': url_for('ttkmj')
}
#yield {
# 'label': '美剧侠',
# 'path': url_for('meijuxia')
#}


if __name__ == '__main__':
plugin.run()
Binary file not shown.
24 changes: 10 additions & 14 deletions plugin.video.mgtv/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ def changeList(url):
url = surl
filter = si[sel].text.encode('utf-8')

if url[0:2] == '//':
url = 'http:' + url
elif url[0] == '/':
url = LIST_URL + url
return mainlist(url, filter)


Expand Down Expand Up @@ -165,7 +161,7 @@ def episodelist(url, id, page):
'path': url_for('episodelist', url=url, id=id, page=page+1)
}

lists = data.get('short', [])
lists = data.get('short')
if lists and (page == total_page):
for series in lists:
d = series.get('t2', '0:0')
Expand Down Expand Up @@ -193,6 +189,10 @@ def episodelist(url, id, page):

@plugin.route('/mainlist/<url>/<filter>/')
def mainlist(url, filter):
if url[:2] == '//':
utl = 'http:' + url
elif url[0] == '/':
url = LIST_URL + url
plugin.set_content('TVShows')
filtitle = '' if filter == '0' else filter
items = [{
Expand All @@ -203,9 +203,9 @@ def mainlist(url, filter):
html = get_html(url)
soup = BeautifulSoup(html, 'html.parser')

tree = soup.findAll('div', {'class': 'm-result-list'})
tree = soup.find('div', {'class': 'm-result-list'})

tree = tree[0].findAll('li', {'class': 'm-result-list-item'})
tree = tree.findAll('li', {'class': 'm-result-list-item'})
for item in tree:
t = item.find('a', {'class': 'u-title'})
title = t.text
Expand Down Expand Up @@ -234,9 +234,9 @@ def mainlist(url, filter):
})

# multiple pages
setpage = soup.findAll('div', {'class': 'w-pages'})
setpage = soup.find('div', {'class': 'w-pages'})
try:
pages = setpage[0].findAll('li')
pages = setpage.findAll('li')
except:
return items

Expand All @@ -245,10 +245,6 @@ def mainlist(url, filter):
href = page.a.get('href')
if href == 'javascript:;' or title == '':
continue
if href[0:2] == '//':
href = 'http:' + href
elif href[0] == '/':
href = LIST_URL + href
items.append({
'label': BANNER_FMT % title,
'path': url_for('mainlist', url=href, filter=filter)
Expand All @@ -267,7 +263,7 @@ def root():
jsdata = loads(get_html(mainAPI))

for item in jsdata['data'][1:]:
url = LIST_URL + '/-------------.html?channelId=' + item['pageType']
url = '/-------------.html?channelId=' + item['pageType']
yield {
'label': item['title'],
'path': url_for('mainlist',
Expand Down
Binary file modified plugin.video.mgtv/plugin.video.mgtv-1.1.8.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion plugin.video.youku/addon.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youku"
name="优酷视频" version="2.0.3"
name="优酷视频" version="2.0.4"
provider-name="yfang1644">
<requires>
<import addon="script.module.beautifulsoup4" version="4.3.2"/>
Expand Down
Loading

0 comments on commit f804ebc

Please sign in to comment.