Update mirror.py
Browse files
mirror.py
CHANGED
|
@@ -33,6 +33,10 @@ def download_from_youtube(video_id, output_path):
|
|
| 33 |
'--merge-output-format', 'mp4',
|
| 34 |
'-o', output_path,
|
| 35 |
'--no-playlist',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
url
|
| 37 |
], capture_output=True, text=True)
|
| 38 |
|
|
@@ -86,4 +90,4 @@ if __name__ == '__main__':
|
|
| 86 |
print(f"SUCCESS:{new_video_id}")
|
| 87 |
except Exception as e:
|
| 88 |
print(f"FAILED: {e}")
|
| 89 |
-
sys.exit(1)
|
|
|
|
| 33 |
'--merge-output-format', 'mp4',
|
| 34 |
'-o', output_path,
|
| 35 |
'--no-playlist',
|
| 36 |
+
'--extractor-args', 'youtube:player_client=ios',
|
| 37 |
+
'--user-agent', 'com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)',
|
| 38 |
+
'--add-header', 'X-Youtube-Client-Name:5',
|
| 39 |
+
'--add-header', 'X-Youtube-Client-Version:19.29.1',
|
| 40 |
url
|
| 41 |
], capture_output=True, text=True)
|
| 42 |
|
|
|
|
| 90 |
print(f"SUCCESS:{new_video_id}")
|
| 91 |
except Exception as e:
|
| 92 |
print(f"FAILED: {e}")
|
| 93 |
+
sys.exit(1)
|