File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ async def search_site(self, url):
74
74
if any (reserved in text for reserved in CLDS ):
75
75
raise CloudFlareError ()
76
76
77
- return list ( await self .get_torrents (response ))
77
+ return [ a async for a in self .get_torrents (response )]
78
78
79
79
@classmethod
80
80
async def get_torrents (cls , data ):
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ class ThePirateBay(BaseSearch):
23
23
24
24
async def get_torrents (self , response ):
25
25
result = await response .json ()
26
- return [[
27
- a ['name' ],
28
- (f"magnet:?xt=urn:btih:{ a ['info_hash' ]} "
29
- f"&dn={ quote (a ['name' ])} &tr={ '&tr=' .join (TRACKERS )} " )
30
- ] for a in result ]
26
+ for mag in result :
27
+ yield [
28
+ mag ['name' ],
29
+ (f"magnet:?xt=urn:btih:{ mag ['info_hash' ]} "
30
+ f"&dn={ quote (mag ['name' ])} &tr={ '&tr=' .join (TRACKERS )} " )
31
+ ]
You can’t perform that action at this time.
0 commit comments