Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,7 +93,7 @@ def get_url():
|
|
| 93 |
|
| 94 |
html = response.text
|
| 95 |
|
| 96 |
-
if 'Just a moment' in html or 'Verifying you are human' in html:
|
| 97 |
failed_attempts.append({
|
| 98 |
'user_agent': user_agent,
|
| 99 |
'status': response.status_code,
|
|
@@ -102,7 +102,11 @@ def get_url():
|
|
| 102 |
continue
|
| 103 |
|
| 104 |
if html_only:
|
| 105 |
-
return html, 200, {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
return jsonify({
|
| 108 |
'success': True,
|
|
|
|
| 93 |
|
| 94 |
html = response.text
|
| 95 |
|
| 96 |
+
if 'Just a moment' in html or 'Verifying you are human' in html or 'cf-chl-widget' in html:
|
| 97 |
failed_attempts.append({
|
| 98 |
'user_agent': user_agent,
|
| 99 |
'status': response.status_code,
|
|
|
|
| 102 |
continue
|
| 103 |
|
| 104 |
if html_only:
|
| 105 |
+
return html, 200, {
|
| 106 |
+
'Content-Type': 'text/html; charset=utf-8',
|
| 107 |
+
'X-User-Agent': user_agent,
|
| 108 |
+
'X-Attempts': str(len(failed_attempts) + 1)
|
| 109 |
+
}
|
| 110 |
|
| 111 |
return jsonify({
|
| 112 |
'success': True,
|