Update app.py
Browse files
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(
|
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 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
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 -----------------------')
|