NAV
python

Tervetuloa MP3.to API -dokumentaatioon

Saadaksesi kehittäjäavaimen mene osoitteeseenkehittäjäportaali

Authorization: <api_key>

Muunna MP3: sta

MP3-WAV

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-wav',
}

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.wav

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - M4A

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-m4a'
}

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.m4a

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 FLACiin

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-flac'
}

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.flac

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 WMA: lle

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-wma'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.wma

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3-WAV

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-aiff'
}

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.aiff

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 AAC: lle

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-aac'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.aac

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - MP2

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-mp2'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp2

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

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-mpeg2'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mpeg2

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - M4R

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-m4r'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.m4r

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - OGG

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-ogg'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.ogg

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - AC3

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-ac3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.ac3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 AMR: ään

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-amr'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.amr

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 DTS: ään

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-dts'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.dts

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 AMR: ään

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-amr'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.amr

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - OPUS

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-opus'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.opus

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

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.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp4

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - AVI

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-avi'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.avi

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - WMV

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-wmv'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.wmv

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - MPEG

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-mpeg'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mpeg

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - MOV

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-mov'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mov

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - MPG

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-mpg'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mpg

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - DIVX

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-divx'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.divx

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 WEBM: ään

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-webm'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.webm

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 FLV: ään

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-flv'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.flv

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - 3GP

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-3gp'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.3gp

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - VOB

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-vob'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.vob

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - AV1

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-av1'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.av1

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - M4V

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-m4v'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.m4v

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 HLS: ään

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-hls'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.hls

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - M3U8

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-m3u8'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.m3u8

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 - MKV

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-mkv'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mkv

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP3 ZIP

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-zip'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.zip

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

Muunna MP3: ksi

WAV MP3

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': 'wav-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

M4A - MP3

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': 'm4a-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

FLAC - MP3

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': 'flac-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

WMA - MP3

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': 'wma-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

AIFF - MP3

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': 'aiff-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP2 - MP3

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': 'mp2-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP2 - MP3

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': 'mp2-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

M4R - MP3

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': 'm4r-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

OGG MP3

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': 'ogg-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

AC3 - MP3

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': 'ac3-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

AMR - MP3

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': 'amr-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

DTS - MP3

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': 'dts-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

OPUS - MP3

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': 'opus-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MP4 - MP3

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': 'mp4-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

AVI - MP3

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': 'avi-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

WMV - MP3

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': 'wmv-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MPEG - MP3

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': 'mpeg-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MOV to MP3

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': 'mov-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MPG - MP3

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': 'mpg-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

DIVX - MP3

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': 'divx-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

WEBM: stä MP3: ksi

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': 'webm-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

FLV - MP3

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': 'flv-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

VOB - MP3

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': 'vob-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

M4V - MP3

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': 'm4v-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

AV1 - MP3

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': 'av1-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi

MKV - MP3

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': 'mkv-mp3'
    }

api_url = 'https://api.mp3.to/v1/convert/'
results_url = 'https://api.mp3.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mp3.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))

Palaa

/path/to/local/file_processed.mp3

Jos haluat tehdä useita, lisää vain lisää tiedostoja luetteloosi