diff --git a/test.py b/test.py index 599e8f4..04e55c2 100644 --- a/test.py +++ b/test.py @@ -1,4 +1,16 @@ -import os +import requests -audio_file = "C:/Users/Administrator/Music/国风堂#哦漏 - 知我.mp3" -os.startfile(audio_file) \ No newline at end of file +url = "https://er-sycdn.kuwo.cn/5a1fdd7e1178a867af57c6b0ba576889/69468dc3/resource/30106/trackmedia/F000000bYDlc2XxKLs.flac" + +headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', + 'Accept-Language': 'en-US,en;q=0.5', + 'Accept-Encoding': 'gzip, deflate', + 'Connection': 'keep-alive', + 'Upgrade-Insecure-Requests': '1', +} + +total_length = int(requests.get(url, stream=True, headers=headers).headers.get('content-length')) + +print(total_length) \ No newline at end of file