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

Pin.it shorturl when tried only outputs the first url after redirect. #5864

Closed
abhranil26 opened this issue Jul 17, 2024 · 4 comments
Closed

Comments

@abhranil26
Copy link

just running

gallery-dl "https://pin.it/39YYRhN0f" -v

this is the verbose output

[gallery-dl][debug] Version 1.27.1 - Git HEAD: 43eaeca50f
[gallery-dl][debug] Python 3.11.9 - macOS-14.5-arm64-arm-64bit
[gallery-dl][debug] requests 2.31.0 - urllib3 2.1.0
[gallery-dl][debug] Configuration Files []
[gallery-dl][debug] Starting DownloadJob for 'https://pin.it/39YYRhN0f'
[pinterest][debug] Using PinterestPinitExtractor for 'https://pin.it/39YYRhN0f'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.pinterest.com:443
[urllib3.connectionpool][debug] https://api.pinterest.com:443 "HEAD /url_shortener/39YYRhN0f/redirect/ HTTP/1.1" 302 0
[pinterest][debug] Using PinterestPinExtractor for 'https://www.pinterest.com/pin/266556871689003952/sent/?invite_code=80139d28e8a34cb38c105de2e84ac671&sender=762164074346835038&sfo=1'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.pinterest.com:443
[urllib3.connectionpool][debug] https://www.pinterest.com:443 "GET /resource/PinResource/get/?data=%7B%22options%22%3A+%7B%22id%22%3A+%22266556871689003952%22%2C+%22field_set_key%22%3A+%22detailed%22%7D%7D&source_url= HTTP/1.1" 200 4453
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): i.pinimg.com:443
[urllib3.connectionpool][debug] https://i.pinimg.com:443 "GET /originals/a5/6e/12/a56e122ccbc44204a9ecf2c0a9c6f303.jpg HTTP/1.1" 200 94097
./gallery-dl/pinterest/pinterest_266556871689003952.jpg

works normally, follows redirect and downloads the file, but i try with -g or -j, the output only contains the first url it is being redirected to.

gallery-dl "https://pin.it/39YYRhN0f" -v -g

this is the verbose output

[gallery-dl][debug] Version 1.27.1 - Git HEAD: 43eaeca50f
[gallery-dl][debug] Python 3.11.9 - macOS-14.5-arm64-arm-64bit
[gallery-dl][debug] requests 2.31.0 - urllib3 2.1.0
[gallery-dl][debug] Configuration Files []
[gallery-dl][debug] Starting UrlJob for 'https://pin.it/39YYRhN0f'
[pinterest][debug] Using PinterestPinitExtractor for 'https://pin.it/39YYRhN0f'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.pinterest.com:443
[urllib3.connectionpool][debug] https://api.pinterest.com:443 "HEAD /url_shortener/39YYRhN0f/redirect/ HTTP/1.1" 302 0
https://www.pinterest.com/pin/266556871689003952/sent/?invite_code=80139d28e8a34cb38c105de2e84ac671&sender=762164074346835038&sfo=1

i tried the same with -j and the json output is also same

[
  [
    6,
    "https://www.pinterest.com/pin/266556871689003952/sent/?invite_code=80139d28e8a34cb38c105de2e84ac671&sender=762164074346835038&sfo=1",
    {}
  ]
]

unable to get the whole extractor data as you would get normally

@mikf
Copy link
Owner

mikf commented Jul 17, 2024

Specify -g multiple times or use -G.

$ gallery-dl -g -g https://pin.it/39YYRhN0f
https://i.pinimg.com/originals/a5/6e/12/a56e122ccbc44204a9ecf2c0a9c6f303.jpg
# -gg would work as well

$ gallery-dl -G https://pin.it/39YYRhN0f
https://i.pinimg.com/originals/a5/6e/12/a56e122ccbc44204a9ecf2c0a9c6f303.jpg

@abhranil26
Copy link
Author

works well in cli, but i am using gallery-dl as a module inside my python program to serve as a api, I am running DataJob to get all data output, what should i set in config there?
I am aware of UrlJob, but i need to work with Datajob, as i need more than just the media URLs

@mikf
Copy link
Owner

mikf commented Jul 20, 2024

DataJob now has a resolve argument which resolves intermediary URLs, like -G does compared to -g, and collects their data as well. (84a634f)

@abhranil26
Copy link
Author

Thank you @mikf 🙏

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

2 participants