From: Adrian Iain Lam Date: Wed, 1 Jul 2026 19:33:04 +0000 (+0100) Subject: Change URL, add commented out 503 block, update useragent X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=a264e2f13d890afc0d970225a28793ac3fed0c31;p=nyaa-comments-rss-generator.git Change URL, add commented out 503 block, update useragent Also change port as both old and new instances are still up --- diff --git a/nyaacomments.py b/nyaacomments.py index 875c5cc..2bbb180 100644 --- a/nyaacomments.py +++ b/nyaacomments.py @@ -46,10 +46,10 @@ To use: For Nyaa: - Get your torrent number For example, https://nyaa.si/view/1002779 -> number is 1002779 - - Your feed URL is https://nyaacomments.tk/1002779 + - Your feed URL is https://adrianiainlam.tk/nyaacomments/1002779 For Sukebei.nyaa: Prepend 's' before the number - For example, https://nyaacomments.tk/s1002779 + For example, https://adrianiainlam.tk/nyaacomments/s1002779 Bug reports welcome at (replace "spam" with "me"), or on . @@ -68,6 +68,13 @@ above) may help. else: sukebei = False + + #self.send_response(503) + #self.send_header('Content-type', 'text/plain') + #self.end_headers() + #self.wfile.write(bytes('503 Service Temporarily Unavailable: Nyaa has blacklisted me :(', 'utf-8')) + #return + try: if self.path[1] == 's': sukebei = True @@ -85,7 +92,7 @@ above) may help. url = "https://sukebei.nyaa.si/view/" + str(nyaaid) else: url = "https://nyaa.si/view/" + str(nyaaid) - useragent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0" + useragent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0" req = requests.get(url, headers={"user-agent": useragent}) self.send_response(req.status_code) @@ -105,7 +112,7 @@ above) may help. htmltitle = parser.getElementsByTagName('title')[0].innerHTML fg.title('Comments for ' + htmltitle) fg.id(url) - fg.link(href='https://nyaacomments.tk' + self.path, rel='self') + fg.link(href='https://adrianiainlam.tk/nyaacomments' + self.path, rel='self') i = 1 timestamp = None @@ -146,5 +153,5 @@ above) may help. if __name__ == '__main__': - server = HTTPServer(('localhost', 2800), NyaaComments) + server = HTTPServer(('localhost', 2799), NyaaComments) server.serve_forever()