mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-06-09 11:27:26 +08:00
添加了对媒体资源服务器的异常处理,参见 issue #691
This commit is contained in:
@@ -453,6 +453,7 @@ class XiaoHongShuCrawler(AbstractCrawler):
|
||||
if not url:
|
||||
continue
|
||||
content = await self.xhs_client.get_note_media(url)
|
||||
await asyncio.sleep(random.random())
|
||||
if content is None:
|
||||
continue
|
||||
extension_file_name = f"{picNum}.jpg"
|
||||
@@ -476,6 +477,7 @@ class XiaoHongShuCrawler(AbstractCrawler):
|
||||
videoNum = 0
|
||||
for url in videos:
|
||||
content = await self.xhs_client.get_note_media(url)
|
||||
await asyncio.sleep(random.random())
|
||||
if content is None:
|
||||
continue
|
||||
extension_file_name = f"{videoNum}.mp4"
|
||||
|
||||
Reference in New Issue
Block a user