-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch_tle.py
More file actions
30 lines (23 loc) · 756 Bytes
/
fetch_tle.py
File metadata and controls
30 lines (23 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
import os
from dotenv import load_dotenv
load_dotenv()
EMAIL = os.getenv("SPACETRACK_EMAIL")
PASSWORD = os.getenv("SPACETRACK_PASSWORD")
BASE_URL = "https://www.space-track.org"
session = requests.Session()
# Giriş yap
login = session.post(f"{BASE_URL}/ajaxauth/login", data={
"identity": EMAIL,
"password": PASSWORD
})
if login.status_code == 200:
print("✅ Space-Track'e başarıyla giriş yapıldı!")
else:
print(f"❌ Giriş başarısız: {login.status_code}")
exit()
# ISS'in TLE verisini çek (NORAD ID: 25544)
url = f"{BASE_URL}/basicspacedata/query/class/gp/NORAD_CAT_ID/25544/format/tle"
response = session.get(url)
print("\n🛸 ISS (Uluslararası Uzay İstasyonu) TLE verisi:")
print(response.text)