ewftrhyjk commited on
Commit
9df76f2
1 Parent(s): 6ea0901

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -30
app.py CHANGED
@@ -55,7 +55,7 @@ def yt_download(url,path,name,width,height,views):
55
  with YoutubeDL(ydl_opts) as ydl:
56
  download_thread = threading.Thread(target=ydl.download, args=([url],))
57
  download_thread.start()
58
- time.sleep(10)
59
  ydl.cancel_download()
60
  except Exception as e:
61
  print(e)
@@ -91,34 +91,38 @@ def appsendvideo(path,name,width,height,views):
91
  except Exception as e:
92
  print(e)
93
 
94
-
95
- while True:
96
- wapp = web.AppRunner(await web_server())
97
- await wapp.setup()
98
- await web.TCPSite(wapp, "0.0.0.0", 7860).start()
99
- data = requests.get("https://stripchat.global/api/front/models?limit=15&offset=0&primaryTag=girls&filterGroupTags=%5B%5B%22ethnicityIndian%22%5D%5D&sortBy=stripRanking&parentTag=ethnicityIndian&userRole=guest&groupId=1")
100
- data = data.json()
101
- models = data["models"]
102
- for i in models:
103
- name = i["username"]
104
- url = i["hlsPlaylist"]
105
- bd = i["broadcastSettings"]
106
- width = bd["width"]
107
- height = bd["height"]
108
- views = i["viewersCount"]
109
- status = i["status"]
110
- path = f'./Videos/{name}.mp4'
111
- ydl_opts = {
112
- 'outtmpl': path,
113
- 'live_stop_duration': 180,
114
- 'quiet': True,
115
- 'format': 'best',
116
- 'nocheckcertificate': True,
117
- }
118
- if status=="public":
119
- download_thread = threading.Thread(target=yt_download, args=(url,path,name,width,height,views,))
120
- download_thread.start()
121
- time.sleep(10)
122
-
123
 
124
 
 
 
 
 
 
 
55
  with YoutubeDL(ydl_opts) as ydl:
56
  download_thread = threading.Thread(target=ydl.download, args=([url],))
57
  download_thread.start()
58
+ time.sleep(300)
59
  ydl.cancel_download()
60
  except Exception as e:
61
  print(e)
 
91
  except Exception as e:
92
  print(e)
93
 
94
+ async def start_services():
95
+ while True:
96
+ wapp = web.AppRunner(await web_server())
97
+ await wapp.setup()
98
+ await web.TCPSite(wapp, "0.0.0.0", 7860).start()
99
+ data = requests.get("https://stripchat.global/api/front/models?limit=15&offset=0&primaryTag=girls&filterGroupTags=%5B%5B%22ethnicityIndian%22%5D%5D&sortBy=stripRanking&parentTag=ethnicityIndian&userRole=guest&groupId=1")
100
+ data = data.json()
101
+ models = data["models"]
102
+ for i in models:
103
+ name = i["username"]
104
+ url = i["hlsPlaylist"]
105
+ bd = i["broadcastSettings"]
106
+ width = bd["width"]
107
+ height = bd["height"]
108
+ views = i["viewersCount"]
109
+ status = i["status"]
110
+ path = f'./Videos/{name}.mp4'
111
+ ydl_opts = {
112
+ 'outtmpl': path,
113
+ 'live_stop_duration': 180,
114
+ 'quiet': True,
115
+ 'format': 'best',
116
+ 'nocheckcertificate': True,
117
+ }
118
+ if status=="public":
119
+ download_thread = threading.Thread(target=yt_download, args=(url,path,name,width,height,views,))
120
+ download_thread.start()
121
+ time.sleep(20)
 
122
 
123
 
124
+ if __name__ == '__main__':
125
+ try:
126
+ loop.run_until_complete(start_services())
127
+ except KeyboardInterrupt:
128
+ print('----------------------- Service Stopped -----------------------')