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

Commit eedc23b

Browse files
authored
Merge pull request #19 from code-yeongyu/feature/fix-crash
Fix code crashes when no video link inputed
2 parents 74640ad + 7709c89 commit eedc23b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

twitter_video_tools/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# pylint: disable=useless-import-alias
22

3+
from .monsnode_parser import MonsnodeParser as MonsnodeParser
4+
from .platform_video_downloader import \
5+
PlatformVideoDownloader as PlatformVideoDownloader
36
from .twitter_crawler import TwitterCrawler as TwitterCrawler
47
from .video_downloader import VideoDownloader as VideoDownloader

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)