Last active
November 24, 2020 13:12
-
-
Save seniorpreacher/43b258c10124f6166969c20355d52996 to your computer and use it in GitHub Desktop.
ncore-rss-for-sonarr
This file contains hidden or 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
import requests | |
import sys | |
import xml.etree.ElementTree as XmlElement | |
from flask import Flask, Response | |
if len(sys.argv) == 1: | |
raise Exception('Provide nCore key as the first argument!') | |
NCORE_URL = 'https://ncore.cc/rss.php?key=' + sys.argv[1] | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
rss_data = XmlElement.fromstring(requests.get(NCORE_URL).content) | |
for item in rss_data[0][10:]: | |
size_tag = XmlElement.Element('size') | |
size_tag.text = '500 MiB' | |
item.append(size_tag) | |
return Response(XmlElement.tostring(rss_data, 'utf-8'), mimetype='application/rss+xml') | |
if __name__ == '__main__': | |
app.run( | |
debug=True, | |
host='0.0.0.0' | |
) |
This file contains hidden or 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
click==6.7 | |
Flask==0.11.1 | |
itsdangerous==0.24 | |
Jinja2==2.9.6 | |
MarkupSafe==1.0 | |
psycopg2==2.7.1 | |
requests==2.12.3 | |
Werkzeug==0.12.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mindegy hogy hova rakod, viszont ez egy webszerver, amit futtatni kell Python3-mal: (mac/linuxon, win-en nézz utána, lehet hogy más)
virtualenv venv
)source venv/bin/activate
)pip install -r requirements.txt
)python ncore-rss-for-sonarr.py
)Amíg fut, a kiírt címen eléred, ezt kell valahova sonarr-ba beírni. (már 3 éves ez a cucc, nem emlékszem hogy hova)
Sonarral sajnos nem fogok tudni segíteni mert egyszer beállítottam 3 éve, futott 1 hónapig, valami baja volt és azóta sem javítottam meg.