Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: video download error 403 (twpornstars) (#1971)

Barbarella666666613641613b7bb
diff --git a/cyberdrop_dl/crawlers/twpornstars.py b/cyberdrop_dl/crawlers/twpornstars.py
index a537f2c8d..0dbcbc685 100644
--- a/cyberdrop_dl/crawlers/twpornstars.py
+++ b/cyberdrop_dl/crawlers/twpornstars.py
@@ -16,7 +16,7 @@ class Selector:
TITLE = "h1.user-page, h1.tag-page, h1.block__title"
THUMBS = "div.block-thumbs a.thumb__link"
- _VIDEO = "video.video-js > source"
+ _VIDEO = "video#video_tag_html5_api > source"
_PHOTO = "img.thumb__img"
MEDIA = f"{_VIDEO}, {_PHOTO}"
@@ -61,6 +61,12 @@ class TwPornstarsCrawler(TwimgCrawler):
return
await self.photo(scrape_item, src)
+ def _prepare_headers(self, scrape_item: ScrapeItem) -> dict[str, str]:
+ """Prepare headers with x.com referer for video.twimg.com URLs."""
+ headers = super()._prepare_headers(scrape_item)
+ headers["Referer"] = "https://x.com/"
+ return headers
+
@error_handling_wrapper
async def collection(self, scrape_item: ScrapeItem) -> None:
title: str = ""