
BGmi 的介绍: t/303853
BGmi 1.4.1 添加了一个叫做 BGmi Script 的功能。 BGmi Script 旨在自定义想订阅的内容。
比如想追 Rick and Morty S03,但是 BGmi 只能追番该怎么办?
将下面的脚本保存在 ~/.bgmi/scripts/rick_and_morty.py
# coding=utf-8 from __future__ import print_function, unicode_literals import re import requests from bs4 import BeautifulSoup as bs from bgmi.script import ScriptBase, parse_episode from bgmi.utils import print_error from bgmi.config import IS_PYTHON3 class Script(ScriptBase): class Model(ScriptBase.Model): bangumi_name = 'Rick and Morty Season 3' cover = 'http://img.itvfans.com/wp-content/uploads/31346.jpg' updated_time = 'Mon' def get_download_url(self): # fetch and return dict resp = requests.get('http://www.itvfans.com/fenji/313463.html').text html = bs(resp, 'lxml') data = html.find(attrs={'id': '31346-3-720p'}) if not data: print_error('No data found, maybe the script is out-of-date.', exit_=False) return {} ret = {} match_episode = re.compile('Rick\.and\.Morty\.S03E(\d+)\.720p') for row in data.find_all('a', attrs={'type': 'magnet'}): link = row.attrs['href'] episode = match_episode.findall(link) if episode: ret[int(episode[0])] = link return ret if __name__ == '__main__': s = Script() print(s.get_download_url()) 依托与 BGmi 的自动更新,每当更新后即可在线观看( mkv 其实还需要转码,转完发现没声音,想哭)
同时 BGmi 也很好的整合了 BGmi Script:


欢迎使用 BGmi ~
地址: https://github.com/RicterZ/BGmi
Docker:docker pull ricterz/bgmi
编写很简单的,大家肯定看看例子就会了(逃
1 songjiaxin2008 2017-09-10 16:50:06 +08:00 via Android 终于提供接口辣敲碗 |
2 DesignerSkyline 2017-09-10 17:33:12 +08:00 via Android 前来支持 RR |
3 loopio 2017-09-10 18:34:48 +08:00 via Android 不错,好用心。前来支持。 |
4 flaneurse 2017-09-10 18:55:49 +08:00 学习一个 |
5 xratzh 2017-09-10 21:32:21 +08:00 via iPhone 支持 Pocky |
6 monburan 2017-09-10 22:43:36 +08:00 前来支持大佬 |
7 Trim21 2017-09-10 22:57:44 +08:00 前来支持大佬( |
8 RqPS6rhmP3Nyn3Tm 2017-09-11 07:27:13 +08:00 via iPad 现在在 nas 上用 rss 订阅自动下载,apple tv 流媒体播放,表示很满意。还有一个自己写的第三方 b 站客户端备用 |
10 RqPS6rhmP3Nyn3Tm 2017-09-11 22:50:13 +08:00 via iPhone @powerbobo 网上有嫖 |