Commit 72114950 authored by TheTechRobo's avatar TheTechRobo
Browse files

Minor tweaks to letsplayindex

parent f9d656b5
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ class LetsPlayIndex(YouTubeService):
        archived = False

        try:
            async with session.head(url, timeout=15) as resp:
            async with session.head(url, timeout=10) as resp:
                lastupdated = time.time()
                status = resp.status
                if status == 301:
@@ -753,12 +753,13 @@ class LetsPlayIndex(YouTubeService):
                    available = str(resp.request_info.url)
                    yield Link(
                        url = available,
                        contains = LinkContains(video = True, metadata = True, thumbnail = True),
                        contains = LinkContains(metadata = True, thumbnail = True),
                        title = "Video"
                    )
                elif status == 404:
                    archived = False
        except (aiohttp.ClientError, asyncio.TimeoutError):
                else:
                    raise AssertionError(f"Unexpected status code {status}")
        except asyncio.TimeoutError:
            # ...why?
            archived = False
            lastupdated = time.time()

+1 −1
Original line number Diff line number Diff line
@@ -414,7 +414,7 @@ class YouTubeResponse(JSONDataclass):
                    queue_task.cancel()
                done_task.cancel()

            done, pending = await asyncio.wait(coroutines, timeout = 0)
            done_tasks, pending = await asyncio.wait(coroutines, timeout = 0)
            assert not pending
        yield None
        any_comments_archived = any(map(lambda e : e.comments, keys))