IEEE rss can not subscribe

I want to subscribe to some IEEE papers, but the rss corresponding to them cannot be subscribed. For example, the following website and its corresponding rss.

https://ieeexplore.ieee.org/rss/TOC10.XML

But it is possible to subscribe on inoreader. Has anyone encountered a similar situation, any solutions?

It’s because they block the user agent TTRSS sends when requesting the feed.

This works:

curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" -sv https://ieeexplore.ieee.org/rss/TOC10.XML 2>&1

But this does not:

curl -H "Tiny Tiny RSS/21.03-ceb8179cc (http://tt-rss.org/)" -sv https://ieeexplore.ieee.org/rss/TOC10.XML 2>&1

I had the same issue. Try putting the following line in your config.php file

putenv('TTRSS_SELF_USER_AGENT=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0');

This line makes tt-rss imitate Firefox.

See also RIP config.php hello classes/config.php - #89 by fox - Development - Tiny Tiny RSS: Community

Also see: Tiny Tiny RSS – Global configuration for additional info regarding ‘config.php’
.

i think it’s TTRSS_HTTP_USER_AGENT, not SELF ?

Code says, “yes - now it is”…

phpstan.neon:      - '#Constant.*\b(SUBSTRING_FOR_DATE|SCHEMA_VERSION|SELF_USER_AGENT|LABEL_BASE_INDEX|PLUGIN_FEED_BASE_INDEX)\b.*not found#'
cache/feeds/69036ea96b637f9a9222a4b91956581a7c60e070.xml:        <description><![CDATA[ <p>i think it’s TTRSS_HTTP_USER_AGENT, not SELF ?</p> ]]></description>
cache/feeds/69036ea96b637f9a9222a4b91956581a7c60e070.xml:<p><code>putenv('TTRSS_SELF_USER_AGENT=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0');</code></p>
classes/logger/sql.php:                         "User agent" => "HTTP_USER_AGENT",
classes/config.php:     const HTTP_USER_AGENT = "HTTP_USER_AGENT";
classes/config.php:             Config::HTTP_USER_AGENT => [ 'Tiny Tiny RSS/%s (https://tt-rss.org/)',
classes/config.php:             return sprintf(self::get(self::HTTP_USER_AGENT), self::get_version());

And if the OP is using docker, they probably want to stick the equivalent change in their .env file, not their config.php.

I couldn’t get setting the user agent in the .env file to work , but this convoluted method worked ( for now ).

  1. Install options_per_feed plugin
  2. Add a feed that I didn’t care about to TT-RSS
  3. Edit the feed with the settings of the feed I actually wanted.
  4. Make sure to change the UA in options per feed setting.
  5. Save.

The reason I added a random feed, is that TT-RSS apparently pulls the feed before it’s be added. So if it cannot pull the feed with the default UAS ( user agent string ), then the feed is not added. It would be nice to change that behavior , or let the end user set the UAS when adding the feed.

I might have to crack open my very dusty php skills , dig in, and see if I can figure out a patch , config setting, or other way to make this a smooth process. That way, no one else has to struggle to add a feed.

For completeness, what I tried with the docker compose .env file were these vars and then stopping/starting docker, but this didn’t work

TTRSS_SELF_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
SELF_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"

It’s TTRSS_HTTP_USER_AGENT but you shouldn’t do this as it breaks more feeds than it fixes, a per feed option is best…

1 Like

The per feed solution is best, for sure. The challenge I see is configuring TT-RSS so that you can specify the UAS when adding a feed.

As far as I can tell, your options to either specify are a global setting or perform a work around method like the one I used.

There is probably a third option of learning php and creating a PR which adds the option
of setting the UAS to the “subscribe to feed”
dialogue box, which would take time for me to learn, plus I would need to make a very strong case for the change.

i’m not going to add something like that to tt-rss itself, that’s what plugins are for.

No worries. When I tried to add a problematic feed, I could not using the “Subscribe to Feed” button as after I press “Subscribe”, the dialogue shows the 403 status code message and does not subscribe to the feed.

Screenshot 2023-08-15 at 8.46.35 AM

The “options_per_feed” plugin can only set the UAS for feeds after they are added. But what if you can’t add them without first setting the UAS? If a plugin can fix/get around that, then great, I’ll write one.

If not, I’ll use the ENV var to set the UAS.

there should be enough hooks to implement this, you just need to add what’s missing. hook_something_subscribe (?) or w/e

1 Like

Thanks! I’ll look into doing that.

This whole matter of having to change the UAS for specific websites , in my opinion, a workaround for misbehaving websites. RSS readers shouldn’t have to do these gymnastics!

you’re preaching to the choir :slight_smile:

1 Like

you can look how af_comics does it, it has a hook which provides an empty XML on subscribe for comics sites which no longer provide rss feeds.

then plugin takes over on feed update and does its thing.

1 Like