New lostfilm plugin#1681
New lostfilm plugin#1681liiight merged 4 commits intoFlexget:developfrom Danfocus:Danfocus-patch-lostfilm
Conversation
original rss feed has link to episode page on site this plugin make right links to torrent files
|
I think you meant to do a UrlRewrite plugin. Look into the sites folder for some of those because this really isn't how it's done |
|
No. |
|
So this plugin is based on using the rss plugin with the relevant feed? If so, might be better to encapsulate this into the plugin: |
Remove rss plugin dependence Change config
|
Ok. I rewrote plugin |
flexget/plugins/sites/lostfilm.py
Outdated
| config = self.build_config(config) | ||
| if config is False: | ||
| return | ||
| rss = feedparser.parse(config['url']) |
There was a problem hiding this comment.
maybe wrap this with try, except
flexget/plugins/sites/lostfilm.py
Outdated
| return | ||
| rss = feedparser.parse(config['url']) | ||
| if rss.get('status') != 200: | ||
| log.error('Received not 200 (OK) status') |
There was a problem hiding this comment.
you can raise PluginError here, will abort task neatly
flexget/plugins/sites/lostfilm.py
Outdated
| log.debug('Item doesn\'t have episode id in link') | ||
| continue | ||
| redirect_url = 'http://www.lostfilm.tv/v_search.php?' \ | ||
| 'c={}&s={}&e={}'.format(lostfilm_num, season_num, episode_num) |
There was a problem hiding this comment.
probably best to pass this as a dict param:
params = {
'c': lostfilm_num,
's': season_num,
'e': episode_num
}then add it to request with query keyword:
response = task.requests.get(redirect_url, query=params)| continue | ||
|
|
||
| try: | ||
| response = task.requests.get(redirect_url) |
There was a problem hiding this comment.
i'm not sure why you want this redirect logic, but if the previous block fails, there's no need to do this again.
You can add else to try, except block
There was a problem hiding this comment.
This is a different requests.
v_search.php have meta refresh in head
<meta content="0; url=http://retre.org/v3/?c=288&s=1&e=14&u=XXXXXX&h=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&n=1" http-equiv="refresh"/>
| new_title_template = \ | ||
| '{}.S{:02d}E{:02d}.{{}}.rus.LostFilm.TV.{{}}.torrent'\ | ||
| .format(series_name_eng, season_num, episode_num) | ||
| except: |
There was a problem hiding this comment.
This is like the worst thing you can do in python :-)
|
Changes are made |
|
Changes are made |
|
Thanks! Can you update the wiki please? |
|
Thank you! I created a page. |
original rss feed has link to episode page on site
this plugin make right links to torrent files
Motivation for changes:
lostfilm.tv change rss-feed
Detailed changes:
Addressed issues:
Config usage if relevant (new plugin or updated schema):
Log and/or tests output (preferably both):