mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 17:32:31 -05:00
* [Streams] Check non-existent streams more than once
- For YouTube streams, it seems like the RSS feed may sometimes return
an HTTP 404 for a channel, even though the channel exists.
- If this happens more than a few times, then we should declare the
stream as non-existent, and purge it from the list of streams we
check.
* [Streams] Move retry_count reset for YouTubeStream
- Reset after the RSS check, since that is the only place where we raise
StreamNotFound in that function.
* [Streams] Increase retry to 20
* [Streams] Reduce retry count to 10
(cherry picked from commit 36ea867dcf)
Co-authored-by: Lui <injabie3@gmail.com>
Co-authored-by: Lui <injabie3@gmail.com>
This commit is contained in:
@@ -31,6 +31,8 @@ from datetime import datetime
|
||||
from collections import defaultdict
|
||||
from typing import Optional, List, Tuple, Union, Dict
|
||||
|
||||
MAX_RETRY_COUNT = 10
|
||||
|
||||
_ = Translator("Streams", __file__)
|
||||
log = logging.getLogger("red.core.cogs.Streams")
|
||||
|
||||
@@ -747,8 +749,14 @@ class Streams(commands.Cog):
|
||||
else:
|
||||
embed = await stream.is_online()
|
||||
except StreamNotFound:
|
||||
log.info("Stream with name %s no longer exists. Removing...", stream.name)
|
||||
to_remove.append(stream)
|
||||
if stream.retry_count > MAX_RETRY_COUNT:
|
||||
log.info("Stream with name %s no longer exists. Removing...", stream.name)
|
||||
to_remove.append(stream)
|
||||
else:
|
||||
log.info(
|
||||
"Stream with name %s seems to not exist, will retry later", stream.name
|
||||
)
|
||||
stream.retry_count += 1
|
||||
continue
|
||||
except OfflineStream:
|
||||
if not stream.messages:
|
||||
|
||||
Reference in New Issue
Block a user