santosderek / imgur-to-folder Goto Github PK
View Code? Open in Web Editor NEWDownload Imgur albums and images to desired folder
License: Other
Download Imgur albums and images to desired folder
License: Other
I go through the setup no problems, yet when I type itf I am not prompted for a client ID instead it just returns "main 07:48:42 PM: Done."
Got this error after providing client_id
client_secret
path
Traceback (most recent call last):
File "/usr/local/bin/itf", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/imgurtofolder/__main__.py", line 142, in main
config = fetch_configuration(args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/imgurtofolder/__main__.py", line 218, in fetch_configuration
config = Configuration(
^^^^^^^^^^^^^^
TypeError: Configuration.__init__() missing 2 required positional arguments: 'access_token' and 'refresh_token'
I tried it on macOS (with python 3.11.7 and pip 23.3.2)
Besides also tried it on Colab (with python 3.10.12 and pip 23.1.2) and got the exact same error
I have 7784 images in Imgur, but Imgur-To-Folder download solely 500.
I reproduce the problem 2 times:
itf -dai --verbose
.Download all 7784 images from more than 100 albums of my account:
Imgur-To-Folder download 500 images:
In first Imgur-To-Folder successful download images:
[INFO] 10:49:28 AM: Downloading: xsprhLh.jpg
[INFO] 10:49:28 AM: xsprhLh.jpg, File Size: 0.02 MB
[INFO] 10:49:29 AM: Downloading: 7gZ9r6F.png
[INFO] 10:49:30 AM: 7gZ9r6F.png, File Size: 0.04 MB
[INFO] 10:49:30 AM: Downloading: DmKNto7.png
[INFO] 10:49:31 AM: DmKNto7.png, File Size: 0.13 MB
Then Imgur-To-Folder not download images, ~40 minutes solely debug info:
[DEBUG] 07:10:51 PM: ID: 5vW6XNO
[DEBUG] 07:10:51 PM: ID: oVnNG1b
[DEBUG] 07:10:52 PM: ID: OcGzZg5
[DEBUG] 07:10:52 PM: ID: z0U37w1
[DEBUG] 07:10:53 PM: ID: jBqAXaY
[DEBUG] 07:10:53 PM: ID: ZeIC8Ce
[DEBUG] 07:10:53 PM: ID: UKMB35k
[DEBUG] 07:10:54 PM: ID: 1bRvyVH
[DEBUG] 07:10:54 PM: ID: aQZe0Yp
[DEBUG] 07:10:55 PM: ID: fQF3AqT
[DEBUG] 07:10:55 PM: ID: gZNytTC
[DEBUG] 07:10:55 PM: ID: UkdniIK
[DEBUG] 07:10:56 PM: ID: Yp2Gk8C
[DEBUG] 07:10:56 PM: ID: ijT5uk9
[DEBUG] 07:10:56 PM: ID: PmTPIqU
[DEBUG] 07:10:57 PM: ID: ZXXCBxo
[DEBUG] 07:10:57 PM: ID: 8r9uwgP
[DEBUG] 07:10:57 PM: ID: VyJ08St
[DEBUG] 07:10:58 PM: ID: eEITQUv
[DEBUG] 07:10:58 PM: ID: 2vVte3J
[DEBUG] 07:10:59 PM: ID: ORRYNCy
[DEBUG] 07:10:59 PM: ID: k7bnVPV
[DEBUG] 07:10:59 PM: ID: 3UYVDd6
[INFO] 07:11:00 PM: Done.
Thanks.
After installing the application, the tutorial docs say that I should be asked to input my Client_ID and Client_Secret, but after install I get nothing asking for it. Here's the output after doing the install pip .
command:
Processing /Users/mediacenter/Imgur-To-Folder
Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ImgurToFolder==0.11.0) (2.28.1)
Collecting pytest-asyncio (from ImgurToFolder==0.11.0)
Obtaining dependency information for pytest-asyncio from https://files.pythonhosted.org/packages/7d/2c/2e5ab8708667972ee31b88bb6fed680ed5ba92dfc2db28e07d0d68d8b3b1/pytest_asyncio-0.21.1-py3-none-any.whl.metadata
Downloading pytest_asyncio-0.21.1-py3-none-any.whl.metadata (4.0 kB)
Collecting pytest>=7.0.0 (from pytest-asyncio->ImgurToFolder==0.11.0)
Obtaining dependency information for pytest>=7.0.0 from https://files.pythonhosted.org/packages/78/af/1a79db43409ea8569a8a91d0a87db4445c7de4cefcf6141e9a5c77dda2d6/pytest-7.4.1-py3-none-any.whl.metadata
Downloading pytest-7.4.1-py3-none-any.whl.metadata (7.9 kB)
Requirement already satisfied: charset-normalizer<3,>=2 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests->ImgurToFolder==0.11.0) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests->ImgurToFolder==0.11.0) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests->ImgurToFolder==0.11.0) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests->ImgurToFolder==0.11.0) (2020.12.5)
Collecting iniconfig (from pytest>=7.0.0->pytest-asyncio->ImgurToFolder==0.11.0)
Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting packaging (from pytest>=7.0.0->pytest-asyncio->ImgurToFolder==0.11.0)
Downloading packaging-23.1-py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 1.3 MB/s eta 0:00:00
Collecting pluggy<2.0,>=0.12 (from pytest>=7.0.0->pytest-asyncio->ImgurToFolder==0.11.0)
Obtaining dependency information for pluggy<2.0,>=0.12 from https://files.pythonhosted.org/packages/05/b8/42ed91898d4784546c5f06c60506400548db3f7a4b3fb441cba4e5c17952/pluggy-1.3.0-py3-none-any.whl.metadata
Downloading pluggy-1.3.0-py3-none-any.whl.metadata (4.3 kB)
Collecting exceptiongroup>=1.0.0rc8 (from pytest>=7.0.0->pytest-asyncio->ImgurToFolder==0.11.0)
Obtaining dependency information for exceptiongroup>=1.0.0rc8 from https://files.pythonhosted.org/packages/ad/83/b71e58666f156a39fb29417e4c8ca4bc7400c0dd4ed9e8842ab54dc8c344/exceptiongroup-1.1.3-py3-none-any.whl.metadata
Downloading exceptiongroup-1.1.3-py3-none-any.whl.metadata (6.1 kB)
Collecting tomli>=1.0.0 (from pytest>=7.0.0->pytest-asyncio->ImgurToFolder==0.11.0)
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Downloading pytest_asyncio-0.21.1-py3-none-any.whl (13 kB)
Downloading pytest-7.4.1-py3-none-any.whl (324 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 324.2/324.2 kB 6.0 MB/s eta 0:00:00
Downloading exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Downloading pluggy-1.3.0-py3-none-any.whl (18 kB)
Building wheels for collected packages: ImgurToFolder
Building wheel for ImgurToFolder (setup.py) ... done
Created wheel for ImgurToFolder: filename=ImgurToFolder-0.11.0-py3-none-any.whl size=12861 sha256=f169e2890fc2326b53ade821748655110de7f837a455bd09dddd11c28730274f
Stored in directory: /Users/mediacenter/Library/Caches/pip/wheels/17/43/33/6d4ee2b7a5c3d166837ba561cea269332279d368a7a46501f2
Successfully built ImgurToFolder
Installing collected packages: tomli, pluggy, packaging, iniconfig, exceptiongroup, pytest, pytest-asyncio, ImgurToFolder
Successfully installed ImgurToFolder-0.11.0 exceptiongroup-1.1.3 iniconfig-2.0.0 packaging-23.1 pluggy-1.3.0 pytest-7.4.1 pytest-asyncio-0.21.1 tomli-2.0.1
It then dropped me back to a blank prompt.
At no point does it ask for a Client_ID or Secret, and I don't know how to trigger it to enter it in manually.
I'm trying to install on a Mac using Ventura 13.5.1. Any suggestions for how to get it working with the client secrets?
Thanks!
Hi. I was wondering if that's possible.
Downloading my own favorites works perfectly, but trying to list or download others just gives
D:\imgur\imgurs>itf --list-all-favorites *username*
[INFO] 03:29:39 PM: Retreving Favorites!
[INFO] 03:29:39 PM: ERROR! When returning favorites:
[INFO] 03:29:39 PM: {'error': 'Unauthorized', 'request': '/3/account/*username*/favorites/0/newest', 'method': 'GET'}
[INFO] 03:29:39 PM: Found 0 favorites
[INFO] 03:29:39 PM: Done.
Hi! Great tool. It would be amazing if you could specify a folder within your favorites to download.
Thanks!
During setup there are two issues that exists in the source files.
config.py
The 'download_folder_path' has an 'r' character sitting outside the quotes
setup.py
It's set to look for 'imgurtofolder' when the source folder is 'ImgurToFolder'
It would be nice to have an option — download solely images, that Imgur-To-Folder not download in previous times.
imgurtofolder --download-account-images --only-new
.itf.yaml
with information about already downloaded images names.imgurtofolder --download-account-images --only-new
second time.itf.yaml
.itf.yaml
.itf.yaml
their names.Thanks.
Hi,
Thank you for this, it works really well. I do have on issue, when I run
imgurToFolder --download-all-favorites userfoo
It download the first batch of images but then stops, I have over 1,000 images in my favourites, is it possible to paginate through a large collection? thank you
I'm not sure if this is an issue with Imgur or not, but I figure this is the best place to start.
I tried to download from my favorites and received the message about going to https://api.imgur.com/oauth2/authorize?client_id=6641d8eb78d0d32 &response_type=token&state=authorizing
I was brought to the Login Screen, logged in and then was brought to where I click "Allow" and then instead of being brought to the front page of Imgur as the directions state, I am brought to a white screen with the following...error?:{"data":{"error":"No client id supplied","request":"/oauth2/authorize","method":"POST"},"success":false,"status":400}
It sounds like to me that this is indicating an incorrect piece of information, but I am not sure what.
Thanks in advance.
I'm very much not a coder, but while it was rough getting the scraper set up I did eventually get it up and running. However, it seems there are certain pages in my imgur favorites that the program is unable to save and which stop the process when it stumbles into them. I can get around them a little by guessing what page they're on and starting the process in the next one, but it's become clear there are a fair few and they each take out their entire page from the archive.
The specific error seems to be with something called the 'conversational dump', but actually understanding what's going wrong lies far beyond my grasp of programming lol.
Anything you've run into before? I've attach some pics with my name painted out if that's any help.
Woops
Getting this error while running the command.
C:\Users\Dharmendra Singh\Documents\Imgur>itf
Traceback (most recent call last):
File "C:\Python\Scripts\itf-script.py", line 11, in
load_entry_point('ImgurToFolder==0.8', 'console_scripts', 'itf')()
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 2852, in load_entry_point
return ep.load()
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 2443, in load
return self.resolve()
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "C:\Python\lib\site-packages\imgurtofolder-0.8-py3.8.egg\imgurtofolder_main_.py", line 6, in
from imgur_downloader import *
File "C:\Python\Scripts\imgur_downloader.py", line 4, in
import('pkg_resources').run_script('ImgurToFolder==0.8', 'imgur_downloader.py')
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "C:\Python\lib\site-packages\pkg_resources_init_.py", line 1462, in run_script
exec(code, namespace, namespace)
File "c:\python\lib\site-packages\imgurtofolder-0.8-py3.8.egg\EGG-INFO\scripts\imgur_downloader.py", line 49, in
CONFIGURATION = json.load(cfile)
File "C:\Python\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "C:\Python\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Python\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 5 column 32 (char 158)
Imgur API returns image upload time. It can be used as the last modified time of the file. You can add an option like --timestamps
for it.
To do this, you need to add a line to this. Where datetime
is image['datetime']
located in download_account_images
, passed to parse_id
.
with open(os.path.join(path, filename), 'wb') as image_file:
req.raw.decode_content = True
shutil.copyfileobj(req.raw, image_file)
os.utime(image_file.name, (datetime, datetime))
First of all thank you for creating a free application like this one.
I have been searching for the past months for a solution to download my 80 000 images on imgur, as there is currently no method to downloading them all.. (download account images doesn't work if you have a few k)
Could it be done through this application?
Thank you!
This is a great program, but it's not able to grab all of my favorites. For either the imgurToFolder --download-latest-favorites [username] or the imgurToFolder --download-oldest-favorites [username], it's only grabbing the latest or oldest 51 "pages" of imgur favorites each page containing 60 pictures or albums for a total of 3060 grabs per command. This is preventing me from getting all of my favorites. Any suggestions for a workaround or is this an innate issue with the imgur api?
When trying to install python using setup.py, I get an error
I do have write access to the folder in question. I am owner of the whole path.
` MINGW64 ~/Imgur-To-Folder (master)
$ python3 setup.py install
running install
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\test-easy-install-17212.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\site-packages\
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.pypa.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.