This repository was archived by the owner on Apr 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ def get_recent_liked_tweet(self, username: str) -> str:
72
72
self ._goto_liked_tweets (username )
73
73
return self ._get_article_links_in_current_screen ()[0 ]
74
74
75
- def get_video_of_tweet (self , link : str , timeout : Optional [float ] = 5000 ) -> list [tuple [str , str ]]:
75
+ def get_video_of_tweet (self , link : str , timeout : Optional [float ] = 10000 ) -> list [tuple [str , str ]]:
76
76
video_links : list [str ] = []
77
77
78
78
def _request_m3u8_capture_handler (request : Request ) -> None :
@@ -101,7 +101,7 @@ def _get_article_links_in_current_screen(self) -> list[str]:
101
101
links : list [str ] = []
102
102
103
103
while True :
104
- articles = self .page .locator ('article' )
104
+ articles = self .page .locator ('article:has(video) ' )
105
105
article_length = articles .count ()
106
106
try :
107
107
links = [
@@ -112,5 +112,6 @@ def _get_article_links_in_current_screen(self) -> list[str]:
112
112
break
113
113
except Error : # if articles in the page are not reachable
114
114
self .page .mouse .wheel (0 , 500 ) # scrolling down to refresh the articles
115
+ self .page .mouse .wheel (0 , - 500 ) # scrolling down to refresh the articles
115
116
116
117
return links
You can’t perform that action at this time.
0 commit comments