Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,20 @@
|
|
| 1 |
-
import
|
| 2 |
import os
|
| 3 |
|
| 4 |
API_KEY = os.getenv("API_KEY")
|
| 5 |
-
headers = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
url = "https://archeanvision.com/api/signals/available"
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
print(response.status_code)
|
| 9 |
print(response.text)
|
| 10 |
|
|
|
|
| 1 |
+
import cloudscraper
|
| 2 |
import os
|
| 3 |
|
| 4 |
API_KEY = os.getenv("API_KEY")
|
| 5 |
+
headers = {
|
| 6 |
+
"Authorization": f"Bearer {API_KEY}",
|
| 7 |
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
| 8 |
+
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
| 9 |
+
"Chrome/115.0.0.0 Safari/537.36"
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
url = "https://archeanvision.com/api/signals/available"
|
| 13 |
+
|
| 14 |
+
# Create a cloudscraper instance
|
| 15 |
+
scraper = cloudscraper.create_scraper() # This will handle Cloudflare challenges
|
| 16 |
+
response = scraper.get(url, headers=headers)
|
| 17 |
+
|
| 18 |
print(response.status_code)
|
| 19 |
print(response.text)
|
| 20 |
|