View Single Post
Old 09-12-2019, 11:54 AM   #3
bobodude
Connoisseur
bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.bobodude ought to be getting tired of karma fortunes by now.
 
Posts: 70
Karma: 1800048
Join Date: Oct 2014
Device: BooX M96
Quote:
Originally Posted by kovidgoyal View Post
It should be a simple three line script to download all custom recipes. Just iterate over the recipe files and call ebook-convert with them.
Thanks again for your speedy answer,

I used your code from here: https://www.mobileread.com/forums/sh...d.php?t=179686

and just changed *.epub to *.recipe, and *.mobi to *.epub

abd added a timestamp

Code:
#!/usr/bin/python
import os, time, glob, subprocess
import datetime
# get the date to add to caption and file name
datetime.datetime.now().strftime("%Y-%m-%d")

files = glob.glob('Armstrong Economics.recipe')

workers = []
while files or workers:
    while len(workers) < 4 and files:
        f = files[0]
        files = files[1:]
        w = subprocess.Popen(['ebook-convert', f,
            os.path.splitext(f)[0]+'_'+datetime.datetime.now().strftime("%Y_%m_%d")+'.epub'])
        workers.append(w)
    for w in list(workers):
        if w.poll() is not None:
            workers.remove(w)
    time.sleep(0.1)

and it works great :-)

tx again

jai ho

Last edited by bobodude; 09-12-2019 at 11:57 AM.
bobodude is offline   Reply With Quote