-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Using gallery-dl programmatically as a Python module, I can of course download to a file like normal, as shown in #642:
>>> import gallery_dl as dl
>>> job = dl.job.DownloadJob('https://www.reddit.com/r/aww/comments/1igojpv/this_loafingblepping_cat_in_istanbul/')
>>> job.run()
./gallery-dl/reddit/aww/1igojpv This loafing_blepping cat in Istanbul.jpg
0I can then see the metadata:
>>> meta = list(job.extractor.items())[0][1]
>>> print(meta["title"])
This loafing/blepping cat in IstanbulBut the media itself is still saved to a file on disk, in this case ./gallery-dl/reddit/aww/1igojpv This loafing_blepping cat in Istanbul.jpg.
Is there a way to instead save the media to a BytesIO object or similar?
My goal is to then save the raw data to a database, and this would mean I could avoid the extra steps of writing and then reading and then deleting the saved file on disc.
Cheers!
Reactions are currently unavailable