Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with cookies and downloading & sorting from a twitter page #1504

Closed
voreman567 opened this issue Apr 25, 2021 · 8 comments
Closed

Errors with cookies and downloading & sorting from a twitter page #1504

voreman567 opened this issue Apr 25, 2021 · 8 comments

Comments

@voreman567
Copy link

So I am having an error with gallery-dl where on some extractors (Most notably twitter) I get the following:
"[twitter][warning] cookies: [Errno 13] Permission denied: './gallery-dl/cookies' "

Which is the folder in which I store my cookies, I don't know why I get this error, but along with that error, if I don't get the 403 error, I get the following:
"[postprocessor][error] 'metadata' initialization failed: TypeError: expected str, got NoneType"

I'm assuming it has to do with my config, as I have a postprocessor part of the twitter config, I dont really fully get it but I copy pasted it from one of my other ones that works in the config and edited it as I wanted the downloader to put retweets into a folder inside the artist's folder. for instance, Normal media: "User/gallery-dl/twitter/Artist/" and retweets: "User/gallery-dl/twitter/Artist/Artist Retweets"

My final error I believe is related to the first one, when I try to download from https://twitter.com/kinkyvorechick/media, I get the following message: [twitter][error] 403 Forbidden ("Not authorized to view the specified user.")
I'm assuming this has to do with the fact that the permission is denied from cookies so it cant see them and let me download their media.

If anyone can help me solve any of these issues it would be greatly appreciated. Thanks.
config - Copy.txt

@mikf
Copy link
Owner

mikf commented Apr 25, 2021

[twitter][warning] cookies: [Errno 13] Permission denied: './gallery-dl/cookies'

Try chmod +r or something. Are you perhaps using the Snap package?

[postprocessor][error] 'metadata' initialization failed: TypeError: expected str, got NoneType

This here is "wrong":

            "postprocessors": [{
                "retweets": true,
                "skip": true,
                "name": "metadata",
                "mode": "custom",
                "directory": "Retweets-{user[name]}",
                "filename": "{author[name]}-{date:%Y-%m-%d}-{filename}.{extension}"
            }]

"mode": "custom" needs a format / content-format.
If you are trying to save retweets into their own directory, that isn't easily doable at the moment.

[twitter][error] 403 Forbidden ("Not authorized to view the specified user.")

That user's tweets are private. This should be fixed when you get your cookies working.
Speaking of, you can add your Twitter auth_token cookie directly into your config file.

@voreman567
Copy link
Author

Its been awhile since ive installed, how do I check if im using the snap package? Also i tried "gallery-dl chmod +r" and it said no suitable extractor found like this:
[1/2] chmod
[gallery-dl][error] No suitable extractor found for 'chmod'
[2/2] +r
[gallery-dl][error] No suitable extractor found for '+r'

@rautamiekka
Copy link
Contributor

rautamiekka commented Apr 25, 2021

gallery-dl chmod +r is unsupported/illegal syntax as far as g-dl is concerned, you most likely meant chmod +x gallery-dl. Also, although this is your ticket, you need to make a new ticket for that cuz it's unrelated.

The only sure way is to run

sudo pip uninstall gallery-dl

to uninstall the PyPi version if you wanna use the Snap one.

@mikf
Copy link
Owner

mikf commented Apr 25, 2021

how do I check if im using the snap package?

Take a look at the output of which gallery-dl. I'm just asking because a Snap might not have the permissions to read other files in your home directory etc.

Also i tried "gallery-dl chmod +r"

chmod is its own program, used to modify access permissions of other files. +r would give read permission to all users.

@voreman567
Copy link
Author

Do I have to use the snap version of gallery-dl to fix this? and for the proper chmod command "chmod +x gallery-dl", It doesnt recognise it, I searched it up and saw chmod was a unix thing, so whats the windows version of that? Im running windows 10.

@mikf
Copy link
Owner

mikf commented Apr 25, 2021

Oh, sorry. For some reason I thought you were on a Unix platform.
You don't need to worry about chmod or Snap then.

I just took another look at your config and realized that ./gallery-dl/cookies is most likely not a file but a directory, given you are using paths like ./gallery-dl/cookies/deviantart.com_cookies.txt for other sites.

Remove the global "cookies": "./gallery-dl/cookies", at the top of your config and add cookies or username&password for Twitter to be able to access that private user.

@voreman567
Copy link
Author

Ok then thanks! It worked, Im still having trouble with the postprocessing thing, but im gonna get rid of it in the twitter section, in the future will there be a way to sort out regular tweets and retweets?

@ExeArco
Copy link

ExeArco commented Apr 26, 2021

in the future will there be a way to sort out regular tweets and retweets?

I too was wondering about this as it seems that there is contradictory information about whether or not you can separate retweets.

#1481
I was wondering about this in my issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants