Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 5dabfa2

Browse files
committed
Fix code crashes when no video link
1 parent 74640ad commit 5dabfa2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

twitter_video_tools/platform_video_downloader.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Optional
22

33
from playwright.sync_api import sync_playwright
4-
from youtube_dl.utils import YoutubeDLError
4+
from youtube_dl.utils import DownloadError, YoutubeDLError
55

66
from .monsnode_parser import MonsnodeParser
77
from .twitter_crawler import TwitterCrawler
@@ -31,8 +31,6 @@ def download_twitter_video(
3131
youtube_dl_option = self._make_youtube_dl_option()
3232
youtube_dl_wrapper.download([link], youtube_dl_option)
3333
except YoutubeDLError as exception:
34-
if 'not authorized' not in str(exception):
35-
raise exception
3634
if not username or not password:
3735
raise Exception('Username and password are required to download private Twitter video') from exception
3836

0 commit comments

Comments
 (0)