Skip to content

Conversation

@FineFindus
Copy link
Collaborator

@FineFindus FineFindus commented Jan 10, 2025

Updates the local feed extraction to only fetch channel tabs that are enabled. This cuts down the amount of requests that are sent, but ultimately not used.

As a side note, in my fork I've experimented with using the more general FeedInfo first, to check if there are even new videos available, which seems to reduce the chance to be rate-limited, so it might be worthwhile to take a look at ;)

Updates the local feed extraction to only fetch channel tabs that are
enabled. This cuts down the amount of requests that are send, but
ultimately not used.
Copy link
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Your implementation looks promising, I'll see what I can re-use for my implementation :)

My idea was to reduce the chances of being blocked by YouTube by refreshing the feed only once a day or so and cache it in the app's database, but we probably should add more measures to decrease chances of being blocked as much as possible.

@Bnyro Bnyro merged commit b50661d into libre-tube:master Jan 11, 2025
2 of 3 checks passed
@FineFindus FineFindus deleted the feat/fetch-needed branch January 11, 2025 11:02
@FineFindus
Copy link
Collaborator Author

My idea was to reduce the chances of being blocked by YouTube by refreshing the feed only once a day or so and cache it in the app's database, but we probably should add more measures to decrease chances of being blocked as much as possible.

I've also added some throttling, similar to how it is done in NewPipe, a couple of weeks ago, however I think the values need to be adjusted, since it, I still experience some rate-limiting.
Since we store the feed, we could also use separate tiers, i.e. fetch channels that upload daily more often than once that upload only once a year, but I'm not sure if that wouldn't defeat the point of having the feed :)

@Bnyro
Copy link
Member

Bnyro commented Jan 11, 2025

I've also added some throttling, similar to how it is done in NewPipe, a couple of weeks ago, however I think the values need to be adjusted, since it, I still experience some rate-limiting.

True, there's certainly a lot that could be done there, some throttling is probably a good idea too, feel free to open a PR for that 👍

Since we store the feed, we could also use separate tiers, i.e. fetch channels that upload daily more often than once that upload only once a year, but I'm not sure if that wouldn't defeat the point of having the feed :)

Hmm, but we probably can't really automate guessing how often a channel uploads videos reliably, so users would need to set that manually 🤔

The best thing to avoid rate limits is probably to not fetch the whole feed at once but in small parts instead, but I'm not too sure how we could really implement that with a decent UX. Users probably want their feed to show all new videos when they refresh it, so fetching only like 10% of the channels subscribed to each day (so users always have a feed that's 10 days old for some channels that haven't been recently refreshed in this example) is also not a perfect solution.

FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Jan 11, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Jan 11, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Jan 13, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Jan 13, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Jan 13, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
Bnyro pushed a commit to FineFindus/LibreTube that referenced this pull request Jan 13, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
Bnyro pushed a commit to FineFindus/LibreTube that referenced this pull request Jan 13, 2025
Throttles the local feed extration in-order to avoid rate-limiting.
This is done, similary to NewPipe, by introducting an articificial
delay every 50 fetched feeds of on average 1 second. These values
may have to be changed in the future.

Ref: libre-tube#6941 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants