1313def translate (text : str ) -> bool :
1414 return text .lower () in ['iya' , 'yes' ]
1515
16-
1716class Regex :
1817 URL_FILTER = re .compile (r'(https?://[\w+&=\.%\-_/?;]+)' )
1918 ORIGIN_URL = re .compile (r'https?://[\w\.-]+/' )
@@ -23,6 +22,7 @@ class Regex:
2322 FROM_SNAPAPP = re .compile (r'^https?://snapsave\.app' )
2423 QUALITY = re .compile (r'"video-quality">(\d+|Audio|HD|SD)' )
2524 DECODER_ARGS = re .compile (r'\(\".*?,.*?,.*?,.*?,.*?.*?\)' )
25+ COVER = re .compile (r'<img src=[\\]?"([\w://\.\=&?-]+)' )
2626
2727
2828def sorted_video (videos : list [FacebookVideo ]) -> list [FacebookVideo ]:
@@ -157,6 +157,11 @@ def __repr__(self) -> str:
157157 return f'{ self .quality .value } ::render={ self .render } ' + ('::' + [
158158 'SD' , 'HD' ][self .is_hd ] if self .is_hd or self .is_sd else '' )
159159
160+ class Videos (list ):
161+ def __init__ (self , cover : str ):
162+ super ().__init__ ()
163+ self .cover = cover
164+
160165
161166class Fb (AsyncClient ):
162167
@@ -190,7 +195,7 @@ async def from_url(self, url: str) -> list[FacebookVideo]:
190195 return await self .extract_content (dec )
191196
192197 async def extract_content (self , src : str ) -> list [FacebookVideo ]:
193- data = []
198+ data = Videos ( Regex . COVER . findall ( src )[ 0 ])
194199 n = Regex .TABLE .findall (src )[0 ].replace ('\\ "' , '"' )
195200 for url , res , render in zip (
196201 Regex .URL_FILTER .findall (n ),
0 commit comments