mirror of
https://github.com/KevinMidboe/bulk-downloader-for-reddit.git
synced 2026-01-19 07:36:01 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a3dcd68a3 | ||
|
|
ac323f2abe | ||
|
|
32d26fa956 | ||
|
|
137481cf3e | ||
|
|
9b63c55d3e | ||
|
|
3a6954c7d3 | ||
|
|
9a59da0c5f | ||
|
|
d56efed1c6 |
@@ -1,4 +1,7 @@
|
|||||||
# Changes on *master*
|
# Changes on *master*
|
||||||
|
## [16/08/2018](https://github.com/aliparlakci/bulk-downloader-for-reddit/tree/d56efed1c6833a66322d9158523b89d0ce57f5de)
|
||||||
|
- Fix the bug that prevents downloading imgur videos
|
||||||
|
|
||||||
## [15/08/2018](https://github.com/aliparlakci/bulk-downloader-for-reddit/tree/adccd8f3ba03ad124d58643d78dab287a4123a6f)
|
## [15/08/2018](https://github.com/aliparlakci/bulk-downloader-for-reddit/tree/adccd8f3ba03ad124d58643d78dab287a4123a6f)
|
||||||
- Prints out the title of posts' that are already downloaded
|
- Prints out the title of posts' that are already downloaded
|
||||||
|
|
||||||
|
|||||||
14
script.py
14
script.py
@@ -23,7 +23,7 @@ from src.tools import (GLOBAL, createLogFile, jsonFile, nameCorrector,
|
|||||||
|
|
||||||
__author__ = "Ali Parlakci"
|
__author__ = "Ali Parlakci"
|
||||||
__license__ = "GPL"
|
__license__ = "GPL"
|
||||||
__version__ = "1.6.2"
|
__version__ = "1.6.3"
|
||||||
__maintainer__ = "Ali Parlakci"
|
__maintainer__ = "Ali Parlakci"
|
||||||
__email__ = "parlakciali@gmail.com"
|
__email__ = "parlakciali@gmail.com"
|
||||||
|
|
||||||
@@ -569,7 +569,9 @@ def download(submissions):
|
|||||||
print(f" – {submissions[i]['postType'].upper()}",end="",noPrint=True)
|
print(f" – {submissions[i]['postType'].upper()}",end="",noPrint=True)
|
||||||
|
|
||||||
if isPostExists(submissions[i]):
|
if isPostExists(submissions[i]):
|
||||||
print(f"\n{nameCorrector(submissions[i]['postTitle'])}")
|
print(f"\n" \
|
||||||
|
f"{submissions[i]['postSubmitter']}_"
|
||||||
|
f"{nameCorrector(submissions[i]['postTitle'])}")
|
||||||
print("It already exists")
|
print("It already exists")
|
||||||
duplicates += 1
|
duplicates += 1
|
||||||
downloadedCount -= 1
|
downloadedCount -= 1
|
||||||
@@ -642,6 +644,12 @@ def download(submissions):
|
|||||||
print(" Total of {} links downloaded!".format(downloadedCount))
|
print(" Total of {} links downloaded!".format(downloadedCount))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
VanillaPrint(
|
||||||
|
f" Bulk Downloader for Reddit v{__version__}\n" \
|
||||||
|
f" Written by Ali PARLAKCI – parlakciali@gmail.com\n\n" \
|
||||||
|
f" https://github.com/aliparlakci/bulk-downloader-for-reddit/"
|
||||||
|
)
|
||||||
GLOBAL.arguments = parseArguments()
|
GLOBAL.arguments = parseArguments()
|
||||||
|
|
||||||
if GLOBAL.arguments.directory is not None:
|
if GLOBAL.arguments.directory is not None:
|
||||||
@@ -650,6 +658,8 @@ def main():
|
|||||||
GLOBAL.directory = Path(input("download directory: "))
|
GLOBAL.directory = Path(input("download directory: "))
|
||||||
|
|
||||||
print("\n"," ".join(sys.argv),"\n",noPrint=True)
|
print("\n"," ".join(sys.argv),"\n",noPrint=True)
|
||||||
|
print(f"Bulk Downloader for Reddit v{__version__}\n",noPrint=True
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
checkConflicts()
|
checkConflicts()
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ def getFile(fileDir,tempDir,imageURL,indent=0):
|
|||||||
]
|
]
|
||||||
|
|
||||||
opener = urllib.request.build_opener()
|
opener = urllib.request.build_opener()
|
||||||
opener.addheaders = headers
|
if not "imgur" in imageURL:
|
||||||
|
opener.addheaders = headers
|
||||||
urllib.request.install_opener(opener)
|
urllib.request.install_opener(opener)
|
||||||
|
|
||||||
if not (os.path.isfile(fileDir)):
|
if not (os.path.isfile(fileDir)):
|
||||||
|
|||||||
Reference in New Issue
Block a user