SoulofSukuna commited on
Commit
4f5bf4c
·
verified ·
1 Parent(s): 42d523e

Update routers/v1/combo_routers.py

Browse files
Files changed (1) hide show
  1. routers/v1/combo_routers.py +24 -20
routers/v1/combo_routers.py CHANGED
@@ -18,7 +18,7 @@ async def get_search_combo(query: str, limit: Optional[int] = 0):
18
  tasks = []
19
  COMBO = {"data": []}
20
  total_torrents_overall = 0
21
- ignoresites = ["glodls", "ybt", "tgx"]
22
  for site in sites_list:
23
  if site not in ignoresites:
24
  limit = (
@@ -60,19 +60,21 @@ async def get_all_trending(limit: Optional[int] = 0):
60
  tasks = []
61
  COMBO = {"data": []}
62
  total_torrents_overall = 0
 
63
  for site in sites_list:
64
- limit = (
65
- all_sites[site]["limit"]
66
- if limit == 0 or limit > all_sites[site]["limit"]
67
- else limit
68
- )
69
- tasks.append(
70
- asyncio.create_task(
71
- all_sites[site]["website"]().trending(
72
- category=None, page=1, limit=limit
 
 
73
  )
74
  )
75
- )
76
  results = await asyncio.gather(*tasks)
77
  for res in results:
78
  if res is not None and len(res["data"]) > 0:
@@ -102,17 +104,19 @@ async def get_all_recent(limit: Optional[int] = 0):
102
  tasks = []
103
  COMBO = {"data": []}
104
  total_torrents_overall = 0
 
105
  for site in sites_list:
106
- limit = (
107
- all_sites[site]["limit"]
108
- if limit == 0 or limit > all_sites[site]["limit"]
109
- else limit
110
- )
111
- tasks.append(
112
- asyncio.create_task(
113
- all_sites[site]["website"]().recent(category=None, page=1, limit=limit)
 
 
114
  )
115
- )
116
  results = await asyncio.gather(*tasks)
117
  for res in results:
118
  if res is not None and len(res["data"]) > 0:
 
18
  tasks = []
19
  COMBO = {"data": []}
20
  total_torrents_overall = 0
21
+ ignoresites = ["glodls", "ybt", "tgx", "torlock", "torrentfunk"]
22
  for site in sites_list:
23
  if site not in ignoresites:
24
  limit = (
 
60
  tasks = []
61
  COMBO = {"data": []}
62
  total_torrents_overall = 0
63
+ ignoresites = ["glodls", "ybt", "tgx", "torlock", "torrentfunk"]
64
  for site in sites_list:
65
+ if site not in ignoresites:
66
+ limit = (
67
+ all_sites[site]["limit"]
68
+ if limit == 0 or limit > all_sites[site]["limit"]
69
+ else limit
70
+ )
71
+ tasks.append(
72
+ asyncio.create_task(
73
+ all_sites[site]["website"]().trending(
74
+ category=None, page=1, limit=limit
75
+ )
76
  )
77
  )
 
78
  results = await asyncio.gather(*tasks)
79
  for res in results:
80
  if res is not None and len(res["data"]) > 0:
 
104
  tasks = []
105
  COMBO = {"data": []}
106
  total_torrents_overall = 0
107
+ ignoresites = ["glodls", "ybt", "tgx", "torlock", "torrentfunk"]
108
  for site in sites_list:
109
+ if site not in ignoresites:
110
+ limit = (
111
+ all_sites[site]["limit"]
112
+ if limit == 0 or limit > all_sites[site]["limit"]
113
+ else limit
114
+ )
115
+ tasks.append(
116
+ asyncio.create_task(
117
+ all_sites[site]["website"]().recent(category=None, page=1, limit=limit)
118
+ )
119
  )
 
120
  results = await asyncio.gather(*tasks)
121
  for res in results:
122
  if res is not None and len(res["data"]) > 0: