Move to standard module structure

This commit is contained in:
Serene-Arc
2021-02-07 11:05:18 +10:00
committed by Ali Parlakci
parent 185335e60b
commit d8a1204d8b
26 changed files with 80 additions and 81 deletions

View File

@@ -0,0 +1,17 @@
import os
import pathlib
from bulkredditdownloader.downloaders.downloaderUtils import getExtension, getFile
from bulkredditdownloader.utils import GLOBAL
class Direct:
def __init__(self, directory: pathlib.Path, post: dict):
post['EXTENSION'] = getExtension(post['CONTENTURL'])
if not os.path.exists(directory):
os.makedirs(directory)
filename = GLOBAL.config['filename'].format(**post) + post["EXTENSION"]
short_filename = post['POSTID'] + post['EXTENSION']
getFile(filename, short_filename, directory, post['CONTENTURL'])