NAV
python

EPUB.to API ഡോക്യുമെന്റേഷനിലേക്ക് സ്വാഗതം

ഒരു ഡെവലപ്പർ കീ ലഭിക്കാൻ ദയവായി ഇതിലേക്ക് പോകുകഡെവലപ്പർ പോർട്ടൽ

Authorization: <api_key>

EPUB- ൽ നിന്ന് പരിവർത്തനം ചെയ്യുക

EPUB-ൽ നിന്ന് PDF

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-pdf'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.pdf

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

MOBI- ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-mobi'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.mobi

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ AZW3 വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-azw3'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.azw3

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ FB2 വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-fb2'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.fb2

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ CBZ വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-cbz'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.cbz

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ CBR വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-cbr'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.cbr

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPOCB മുതൽ DOCX വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-docx'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.docx

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

DOC- ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-doc'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.doc

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

HTML- ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-html'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.html

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

ആർ‌ടി‌എഫിലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-rtf'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.rtf

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ PNG വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-png'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.png

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

എസ്‌വി‌ജിയിലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-svg'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.svg

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ JPG വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-jpg'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.jpg

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ BMP വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-bmp'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.bmp

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

ZIP- ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-zip'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.zip

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

GIF- ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-gif'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.gif

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB മുതൽ TIFF വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.epub', 'testfiles/blah.epub', 'testfiles/blah.epub']
params = {
    'lang': 'en',
    'convert_to': 'epub-tiff'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.tiff

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

EPUB- ലേക്ക് പരിവർത്തനം ചെയ്യുക

PDF-ലേക്ക് EPUB

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-epub'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.epub

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

DOCX മുതൽ EPUB വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.docx', 'testfiles/blah.docx', 'testfiles/blah.docx']
params = {
    'lang': 'en',
    'convert_to': 'docx-epub'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.epub

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക

DOC മുതൽ EPUB വരെ

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.doc', 'testfiles/blah.doc', 'testfiles/blah.doc']
params = {
    'lang': 'en',
    'convert_to': 'doc-epub'
}

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


def download_file(url, local_filename):
    with requests.get("https://api.epub.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

തിരിച്ചു വരും

/path/to/local/file_processed.epub

ഒന്നിലധികം ഉണ്ടാക്കാൻ നിങ്ങളുടെ ലിസ്റ്റിൽ കൂടുതൽ ഫയലുകൾ ഇടുക