Uhhy commited on
Commit
013012e
·
verified ·
1 Parent(s): 302eff5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +66 -5
app.py CHANGED
@@ -152,24 +152,85 @@ def instagram_login(username: str, password: str):
152
  raise HTTPException(status_code=401, detail="Authentication failed")
153
 
154
  def tiktok_login(username: str, password: str):
 
155
  session = requests.Session()
156
- return session
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  def youtube_login(username: str, password: str):
 
159
  session = requests.Session()
160
- return session
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  def facebook_login(username: str, password: str):
 
163
  session = requests.Session()
164
- return session
 
 
 
 
 
 
 
 
 
 
 
165
 
166
  def twitch_login(username: str, password: str):
 
167
  session = requests.Session()
168
- return session
 
 
 
 
 
 
 
 
 
 
 
169
 
170
  def spotify_login(username: str, password: str):
 
171
  session = requests.Session()
172
- return session
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
  def simulate_view(video_id: str, platform: str, proxy: str, session: requests.Session):
175
  proxies = {
 
152
  raise HTTPException(status_code=401, detail="Authentication failed")
153
 
154
  def tiktok_login(username: str, password: str):
155
+ login_url = "https://www.tiktok.com/login/"
156
  session = requests.Session()
157
+
158
+ login_data = {
159
+ "username": username,
160
+ "password": password
161
+ }
162
+
163
+ response = session.post(login_url, data=login_data)
164
+
165
+ if response.status_code == 200:
166
+ return session
167
+ else:
168
+ raise HTTPException(status_code=401, detail="Authentication failed")
169
 
170
  def youtube_login(username: str, password: str):
171
+ login_url = "https://accounts.google.com/ServiceLogin"
172
  session = requests.Session()
173
+
174
+ login_data = {
175
+ "username": username,
176
+ "password": password
177
+ }
178
+
179
+ response = session.post(login_url, data=login_data)
180
+
181
+ if response.status_code == 200:
182
+ return session
183
+ else:
184
+ raise HTTPException(status_code=401, detail="Authentication failed")
185
 
186
  def facebook_login(username: str, password: str):
187
+ login_url = "https://www.facebook.com/login"
188
  session = requests.Session()
189
+
190
+ login_data = {
191
+ "email": username,
192
+ "pass": password
193
+ }
194
+
195
+ response = session.post(login_url, data=login_data)
196
+
197
+ if response.status_code == 200:
198
+ return session
199
+ else:
200
+ raise HTTPException(status_code=401, detail="Authentication failed")
201
 
202
  def twitch_login(username: str, password: str):
203
+ login_url = "https://www.twitch.tv/login"
204
  session = requests.Session()
205
+
206
+ login_data = {
207
+ "login": username,
208
+ "password": password
209
+ }
210
+
211
+ response = session.post(login_url, data=login_data)
212
+
213
+ if response.status_code == 200:
214
+ return session
215
+ else:
216
+ raise HTTPException(status_code=401, detail="Authentication failed")
217
 
218
  def spotify_login(username: str, password: str):
219
+ login_url = "https://accounts.spotify.com/api/token"
220
  session = requests.Session()
221
+
222
+ login_data = {
223
+ "username": username,
224
+ "password": password
225
+ }
226
+
227
+ response = session.post(login_url, data=login_data)
228
+
229
+ if response.status_code == 200:
230
+ return session
231
+ else:
232
+ raise HTTPException(status_code=401, detail="Authentication failed")
233
+
234
 
235
  def simulate_view(video_id: str, platform: str, proxy: str, session: requests.Session):
236
  proxies = {