Quote:
Originally Posted by kovidgoyal
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