2
from flexget.plugin import *
4
log = logging.getLogger("stmusic")
6
class UrlRewriteSTMusic:
7
"""STMusic urlrewriter."""
9
def url_rewritable(self, feed, entry):
10
return entry['url'].startswith('http://www.stmusic.org/details.php?id=')
12
def url_rewrite(self, feed, entry):
14
entry['url'] = entry['url'].replace('details.php?id=', 'download.php/')
15
entry['url'] = entry['url'] + '/%s.torrent' % (urllib.quote(entry['title'], safe=''))
17
register_plugin(UrlRewriteSTMusic, 'stmusic', groups=['urlrewriter'])