Closed husudosu closed 2 years ago
At some point, this feature was part of the module. But I can't remember why I removed it. I think we can add this again, go for it.
@JuanjoSalvador
Problematic about using RSS is the additional complexity. While using https://nyaa.si/?page=rss yields an RSS (XML) response, using the same logic on users (https://nyaa.si/user/ohys?page=rss) will result in a normal HTML response. Therefore, while possible in some scenarios, we would still have to maintain the HTML parser aside from the XML data extraction.
This might be the reason why you removed it in the first place.
I think we could keep the eye on RSS frontpage and avoid the users RSS, or slit it into two separate functions. Let me give it a try.
If you're interested, I just had a look myself. But unfortunately, the completed_count is the only thing that we can't read from the RSS feed is the completed_count. Additionally, the magnet link has to be generated. Otherwise, all information is present within the feed.
If you're interested, I could do a cleanup of my fork and create a PR (https://github.com/Euklios/NyaaPy/commit/a89bca61e50b7b9e0004a8af9c598956c16a76a3)
Feel free to create the PR :D I'm gonna add some tests and checks today to the repo, so in case you're gonna make a PR, make sure your code is PEP8-compilant.
While using https://nyaa.si/?page=rss yields an RSS (XML) response, using the same logic on users (https://nyaa.si/user/ohys?page=rss) will result in a normal HTML response.
You can use https://nyaa.si/?page=rss&u=ohys, though.
I guess it would be a little faster, using RSS source for last uploaded torrents. What do you think about it? It can done via LXML or we could use feed_parser library. RSS source contains almost every torrent of the first page of nyaa (1 missing if I saw it correctly).