mirror of
https://github.com/KevinMidboe/bulk-downloader-for-reddit.git
synced 2025-10-29 17:40:15 +00:00
Removed installing packages in the runtime
This commit is contained in:
@@ -4,19 +4,13 @@ import sys
|
|||||||
import urllib.request
|
import urllib.request
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import imgurpython
|
||||||
|
|
||||||
from src.errors import (AlbumNotDownloadedCompletely, FileAlreadyExistsError,
|
from src.errors import (AlbumNotDownloadedCompletely, FileAlreadyExistsError,
|
||||||
FileNameTooLong, ImgurLoginError,
|
FileNameTooLong, ImgurLoginError,
|
||||||
NotADownloadableLinkError)
|
NotADownloadableLinkError)
|
||||||
from src.tools import GLOBAL, nameCorrector, printToFile
|
from src.tools import GLOBAL, nameCorrector, printToFile
|
||||||
|
|
||||||
try:
|
|
||||||
from imgurpython import *
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
print("\nimgurpython not found on your computer, installing...\n")
|
|
||||||
from src.tools import install
|
|
||||||
install("imgurpython")
|
|
||||||
from imgurpython import *
|
|
||||||
|
|
||||||
VanillaPrint = print
|
VanillaPrint = print
|
||||||
print = printToFile
|
print = printToFile
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,7 @@ import random
|
|||||||
import socket
|
import socket
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
try:
|
import praw
|
||||||
import praw
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
print("\nPRAW not found on your computer, installing...\n")
|
|
||||||
from src.tools import install
|
|
||||||
install("praw")
|
|
||||||
import praw
|
|
||||||
|
|
||||||
from prawcore.exceptions import NotFound, ResponseException, Forbidden
|
from prawcore.exceptions import NotFound, ResponseException, Forbidden
|
||||||
|
|
||||||
from src.tools import GLOBAL, createLogFile, jsonFile, printToFile
|
from src.tools import GLOBAL, createLogFile, jsonFile, printToFile
|
||||||
|
|||||||
@@ -2,20 +2,11 @@ import io
|
|||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
try:
|
|
||||||
from pip import main as pipmain
|
|
||||||
except:
|
|
||||||
from pip._internal import main as pipmain
|
|
||||||
|
|
||||||
from os import makedirs, path, remove
|
from os import makedirs, path, remove
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from src.errors import FileNotFoundError
|
from src.errors import FileNotFoundError
|
||||||
|
|
||||||
def install(package):
|
|
||||||
pipmain(['install', package])
|
|
||||||
|
|
||||||
class GLOBAL:
|
class GLOBAL:
|
||||||
"""Declare global variables"""
|
"""Declare global variables"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user