hyPnOtICDo0g / rss-chan

A telegram RSS feed reader bot, written using python and feedparser.
GNU General Public License v3.0
102 stars 77 forks source link

[Feature Request] Display feeds based on a Template #2

Closed Ritikaa18 closed 2 years ago

Ritikaa18 commented 3 years ago

Hey, thank you for this amazing project.

I would like to request 2 features here,

  1. Adding custom message to be sent with the entry in message.
  2. Selecting which entry should be sent for each feeds. Ex- /mirror entry.link or /mirror entry.enclosures[0]['href'] or /mirror entry['torrent_magneturi']

Since different sites gives magnet/download links in different entries it'd be helpful to select the ones we need.

hyPnOtICDo0g commented 3 years ago

@Ritikaa18 Your welcome. :)

Custom messages? If you could give me an example, I'll see whether it's worth implementing. I'm not sure about your second request though. If you could send me some feeds which have torrent_magneturi as an entry I'll look into it.

Open two separate issues for each feature next time as it's easier to manage :)

Ritikaa18 commented 3 years ago

Open two separate issues for each feature next time as it's easier to manage :)

Hey, I'm sorry for posting both feature requests as a single issue. I did it because I think both are interconnected.

Custom messages? If you could give me an example, I'll see whether it's worth implementing.

You have set-up a standard format for feeds like feed title and feed url. But I would like to have url and published time or some other entry along too. So it'd be nice that we could pick which entry should be set for a particular feed url. When it comes to custom message I could set my channel name at first or some other thing which is not in the entries. Just some random message i want with the feed message.

I'm not sure about your second request though. If you could send me some feeds which have torrent_magneturi as an entry I'll look into it.

Clearly not all the torrent sites provides magnet links or torrent direct links in link entry itself. Most of the torrent sites keep the download link in entry.enclosures[0]['href'] and https://eztv.re/ezrss.xml - this site provides magnet link in torrent_magneturi, there's direct torrent link in entry.link too, but sometimes I have to requote it to avoid broken links. So I prefer magnet links.

https://t.me/el_monitorro_bot - What I'm asking in both request is kinda like /set_template funtion of this bot. :)

hyPnOtICDo0g commented 3 years ago

@Ritikaa18

But I would like to have url and published time or some other entry along too.

Isn't time displayed by telegram by default? Even if I had to implement this, I would have to support all time zones. I guess it's better off just looking at the time displayed at the end of each message.

Just some random message i want with the feed message.

I still don't see the point of CUSTOM_MESSAGE, but I could add it as an option in the config. It would appear in this format:

This is your new feed:
<item_name>
<item_url>

Here, CUSTOM_MESSAGE = "This is your new feed:". I've opened #4 regarding this.

Clearly not all the torrent sites provides magnet links or torrent direct links in link entry itself.

I'm not really sure about this though. I can't add support to certain torrent sites since this is a generic feedparser. If you're using the bot with such sites, you could tweak it yourself though.

What I'm asking in both request is kinda like /set_template funtion of this bot.

The set template feature does sound good, but I'd have to change the core logic. I could add feed_name, feed_description & item_description. Maybe some other day. I'll leave the issue open incase anyone wants to PR.

Ritikaa18 commented 3 years ago

I tried to tweak it myself, I just wanted to change the entry.link to entry.enclosures[0]['href']. So I had to change it at 2 places, 1st one is when new feeded is added bot sends the last entry. That works. Bots send the link inside the enclosure url.

I couldn't figure out what should i edit in the 2nd place - https://github.com/hyPnOtICDo0g/rss-chan/blob/00f1b62e87047f4dea15b78fb5161942077c113c/telegramRSSbot.py#L261

Could you guide me what to edit to get the enclosure url atleast please?

hyPnOtICDo0g commented 3 years ago

@Ritikaa18 Ah, that's not how it works ;_;

If you're using this exclusively for magnet URLs, You would have to update the database with a new magnet URL every time a new feed pops up. You would also have to change it here or else the /get command is gonna break. Changing it in just two places will partially break the script. But if you're satisfied with whatever you've got, just leave it as-is. It is working on your side because you're updating the database with the latest item_url instead of the magnet_url. Since your feed contains both, it's not very different.

sunilroyy007 commented 3 years ago

Open two separate issues for each feature next time as it's easier to manage :)

Hey, I'm sorry for posting both feature requests as a single issue. I did it because I think both are interconnected.

Custom messages? If you could give me an example, I'll see whether it's worth implementing.

You have set-up a standard format for feeds like feed title and feed url. But I would like to have url and published time or some other entry along too. So it'd be nice that we could pick which entry should be set for a particular feed url. When it comes to custom message I could set my channel name at first or some other thing which is not in the entries. Just some random message i want with the feed message.

I'm not sure about your second request though. If you could send me some feeds which have torrent_magneturi as an entry I'll look into it.

Clearly not all the torrent sites provides magnet links or torrent direct links in link entry itself. Most of the torrent sites keep the download link in entry.enclosures[0]['href'] and https://eztv.re/ezrss.xml - this site provides magnet link in torrent_magneturi, there's direct torrent link in entry.link too, but sometimes I have to requote it to avoid broken links. So I prefer magnet links.

https://t.me/el_monitorro_bot - What I'm asking in both request is kinda like /set_template funtion of this bot. :)

hmm issue already raised.. i was asking about this in that pr comments

hyPnOtICDo0g commented 2 years ago

7179de6 closes this issue.