MP4.to API құжаттамасына қош келдіңіз
Әзірлеуші кілтін алу үшін өтіңізәзірлеуші порталы
Authorization: <api_key>
MP4-тен түрлендіру
WAV үшін MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-wav',
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.wav
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - M4A
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-m4a'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.m4a
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
FLAC-қа MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-flac'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.flac
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен WMA-ға дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-wma'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.wma
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
WAV үшін MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-aiff'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.aiff
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен AAC-қа
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-aac'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.aac
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP2-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mp2'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp2
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - M4R
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-m4r'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.m4r
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен OGG-ге
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-ogg'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.ogg
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен AC3-ке дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-ac3'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.ac3
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - AMR
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-amr'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.amr
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
DTS-ке MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-dts'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.dts
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - AMR
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-amr'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.amr
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - OPUS
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-opus'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.opus
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен MP3-ке
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mp3'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp3
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен AVI-ге дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-avi'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.avi
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен WMV-ге
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-wmv'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.wmv
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MPEG-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mpeg'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mpeg
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін MOV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mov'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mov
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MPG-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mpg'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mpg
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен DIVX-ке дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-divx'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.divx
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен WEBM-ге
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-webm'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.webm
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
FLV-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-flv'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.flv
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен 3GP-ге
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-3gp'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.3gp
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - VOB
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-vob'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.vob
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен AV1-ге
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-av1'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.av1
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - M4V
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-m4v'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.m4v
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - HLS
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-hls'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.hls
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен M3U8-ге дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-m3u8'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.m3u8
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 - MKV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-mkv'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mkv
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен GIF-ке
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-gif'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.gif
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
WEBP-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-webp'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.webp
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен ZIP-ке
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp4-zip'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.zip
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 түрлендіру
MP4 үшін WAV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'wav-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
M4A - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'm4a-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-қа FLAC
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'flac-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
WMA - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'wma-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін AIFF
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'aiff-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP2-ден MP4-ке дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp2-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP2-ден MP4-ке дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mp2-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін M4R
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'm4r-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
OGG - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'ogg-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
AC3 - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'ac3-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
AMR-ден MP4-ке дейін
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'amr-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін DTS
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'dts-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін OPUS
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'opus-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP3 үшін MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp3', 'testfiles/blah.mp3', 'testfiles/blah.mp3']
params = {
'lang': 'en',
'convert_to': 'mp3-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен AVI
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'avi-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-қа WMV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'wmv-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін MPEG
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mpeg-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін MOV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mov-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MPG - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mpg-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін DIVX
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'divx-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-қа WEBM
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'webm-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-тен FLV
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'flv-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін VOB
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'vob-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4 үшін M4V
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'm4v-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
AV1 - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'av1-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MKV - MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mp4', 'testfiles/blah.mp4', 'testfiles/blah.mp4']
params = {
'lang': 'en',
'convert_to': 'mkv-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
MP4-қа GIF
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.gif', 'testfiles/blah.gif', 'testfiles/blah.gif']
params = {
'lang': 'en',
'convert_to': 'gif-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз
WEBP-ге MP4
import requests
import time
import shutil
import json
headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.webp', 'testfiles/blah.webp', 'testfiles/blah.webp']
params = {
'lang': 'en',
'convert_to': 'webp-mp4'
}
api_url = 'https://api.mp4.to/v1/convert/'
results_url = 'https://api.mp4.to/v1/results/'
def download_file(url, local_filename):
with requests.get("https://api.mp4.to/%s" % url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return local_filename
def convert_files(api_url, params, headers):
files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
print(files)
r = requests.post(
url=api_url,
files=files,
data=params,
headers=headers
)
return r.json()
def get_results(params):
if params.get('error'):
return params.get('error')
r = requests.post(
url=results_url,
data=params
)
data = r.json()
finished = data.get('finished')
while not finished:
if int(data.get('queue_count')) > 0:
print('queue: %s' % data.get('queue_count'))
time.sleep(5)
results = get_results(params)
print(results)
results = json.dumps(results)
if results:
break
if finished:
print(data.get('files'))
for f in data.get('files'):
print(f.get('url'))
download_file("%s" % f.get('url'), "%s" % f.get('filename'))
return {"finished": "files downloaded"}
return r.json()
get_results(convert_files(api_url, params, headers))
Қайта береді
/path/to/local/file_processed.mp4
Бірнеше файлды жасау үшін тізімге көбірек файлдарды қойыңыз