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

[Site Support Request] Wikipedia and Wikimedia #1443

Open
paulolimac opened this issue Apr 8, 2021 · 6 comments
Open

[Site Support Request] Wikipedia and Wikimedia #1443

paulolimac opened this issue Apr 8, 2021 · 6 comments

Comments

@paulolimac
Copy link

Is there any way to download from Wikipedia and Wikimedia domains?
Unsuccessfully, my commands:

$ gallery-dl https://commons.wikimedia.org/wiki/Category:1st_Horseman_of_the_Apocalypse
[gallery-dl][error] No suitable extractor found for 'https://commons.wikimedia.org/wiki/Category:1st_Horseman_of_the_Apocalypse'

$ gallery-dl https://en.wikipedia.org/wiki/Gustave_Dor%C3%A9
[gallery-dl][error] No suitable extractor found for 'https://en.wikipedia.org/wiki/Gustave_Dor%C3%A9'
@mikf
Copy link
Owner

mikf commented Apr 8, 2021

Not at the moment.

@paulolimac
Copy link
Author

ok then. thanks for reply :)

@mikf mikf reopened this Apr 10, 2021
@mikf mikf changed the title [question] how to download images from wikipedia and wikimedia? [Site Support Request] Wikipedia and Wikimedia Apr 10, 2021
@Ailothaen
Copy link
Contributor

After looking about it a bit, Wikipedia (and any Mediawiki website, in general) has an API that can be used to retrieve images from an article (and surely other pages)

An example:

  1. https://en.wikipedia.org/w/api.php?action=parse&page=Pet_door&prop=images&format=json to retrieve all image names from an article
  2. https://en.wikipedia.org/w/api.php?action=query&titles=File:Gatera_de_ademuz.jpg&prop=imageinfo&iiprop=url to retrieve the full URL for an image name (since the exact path can change depending on the language version)

I guess I could try to implement an extractor if I someday find the time for it 0:)

@rautamiekka
Copy link
Contributor

rautamiekka commented May 11, 2021

I wonder if there's a public out-of-source-code info on the Mediawiki URL syntax ... I couldn't find with an extremely fast try, and don't feel like checking the source code.

At 1st I was thinking "Match until a question mark after /wiki/" cuz I knew Mediawiki supports sub-articles which show up as /wiki/ORIGINAL_ARTICLE/SUB_ARTICLE (repeating the /SUB_ARTICLE part), but then I started thinking maybe matching until a question mark would exclude some articles.

@Ailothaen
Copy link
Contributor

Random question for @mikf (it is slightly related to this issue, but I do not see any better place to post it): is there a documentation that specifies how to write an extractor? By that, I mean how to use the Extractor class and which methods are to be used depending on context.

mikf added a commit that referenced this issue Jan 18, 2024
- support mediawiki.org
- support mariowiki.com (#3660)

- combine code into a single extractor
  (use prefix as subcategory)
- handle non-wiki instances
- unescape titles
mikf added a commit that referenced this issue Jan 20, 2024
Wikis hosted on fandom.com are just wikimedia instances
and support its API.
@GrimPixel
Copy link

I have done this in my own repository: download.py. I think you may get inspired.

bradenhilton pushed a commit to bradenhilton/gallery-dl that referenced this issue Feb 5, 2024
- support mediawiki.org
- support mariowiki.com (mikf#3660)

- combine code into a single extractor
  (use prefix as subcategory)
- handle non-wiki instances
- unescape titles
bradenhilton pushed a commit to bradenhilton/gallery-dl that referenced this issue Feb 5, 2024
Wikis hosted on fandom.com are just wikimedia instances
and support its API.
mikf added a commit that referenced this issue Feb 10, 2024
add wikidata.org and wikivoyage.org
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

5 participants