DIYgod / DIYgod/RSSHub

Some telegram channels being rate limited: A wait of 2787 seconds is required (caused by contacts.ResolveUsername)

Open
#20,454 4 comments 2 reactions 0 assignees View on GitHub
RSS bug
Dominant language
TypeScript
Stars
46.2k
Forks
10.2k
Avg merge
8h 48m
Merged PRs (30d)
175

Description

### Routes

```routes
/telegram/channel/:username/:routeParams?
```

### Full routes

```fullroutes
/telegram/channel/dtfbest
```

### Related documentation

https://docs.rsshub.app/routes/social-media#channel

### What is expected?

Channel fetch avoids being rate limited if possible

### What is actually happening?

Channel fetch is being rate limited by telegram in Folo client

### Deployment information

RSSHub demo (https://rsshub.app)

### Deployment information (for self-hosted)

_No response_

### Additional info

```shell
Some telegram channels in Folo have this error:

'''
Error
since 2 months ago
A wait of 2787 seconds is required (caused by contacts.ResolveUsername)
'''

Example:
rsshub://telegram/channel/dtfbest

Folo already has the issue created (https://github.com/RSSNext/Folo/issues/4503) with another channel exampe, but there was no activity for a couple of months, and anyway shouldn't rate limit issues be attempted to resolve on the route side first? From the issue it looks like this also affects self-hosted instances.

Such error may be due to telegram having a very small limit of queries per day for resolving user id from a username:
https://ru.stackoverflow.com/questions/1566410/%D0%9E%D0%B1%D1%85%D0%BE%D0%B4-flood-wait-caused-by-contacts-resolveusername
https://gram.js.org/beta/classes/TelegramClient.html#getEntity
https://gram.js.org/beta/classes/TelegramClient.html#getInputEntity

The last successfully fetched (by Folo) post date (September 16) coincides with the date this large commit was merged:
https://github.com/DIYgod/RSSHub/pull/18268

Did this route maybe start resolving usernames more frequently after this change?

Later the input entity caching commit was merged, but looks like in case of Folo it did not help.
https://github.com/DIYgod/RSSHub/pull/20128

Can this issue be resolved on the route side?
```

### This is not a duplicated issue

- [x] I have searched [existing issues](https://github.com/DIYgod/RSSHub/issues) to ensure this bug has not already been reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.