|
@@ -2,6 +2,9 @@ import rpyc
|
|
|
import os
|
|
|
import random
|
|
|
import string
|
|
|
+import requests
|
|
|
+from bs4 import BeautifulSoup
|
|
|
+
|
|
|
|
|
|
def randomString(stringLength=10):
|
|
|
letters = string.ascii_lowercase
|
|
@@ -25,6 +28,18 @@ def mp3_to_anchor(fname):
|
|
|
# conn.execute('import os')
|
|
|
|
|
|
|
|
|
-fname=mp3_to_anchor('c:/tmp/haka.mp3')
|
|
|
-print(fname)
|
|
|
+def download_mp4(url):
|
|
|
+ headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'}
|
|
|
+ with open('ai_spokesgirl.mp4','wb') as f:
|
|
|
+ r = requests.get(url, headers=headers, stream=True)
|
|
|
+ for chunk in r.iter_content(chunk_size=1024):
|
|
|
+ if chunk:
|
|
|
+ f.write(chunk)
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ fname=mp3_to_anchor('/Users/zooeytsai/Downloads/p3r68-cdx67 6/osi6k-0qc1h.mp3')
|
|
|
+ print(fname)
|
|
|
+ download_mp4(fname)
|
|
|
+
|
|
|
|