-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: None
-
Component/s: URL cleanup
-
None
Some sources, such as Wikidata, use https://openlibrary.org/works/$id to link to every kind of entity, since the /authors, /books and /works URLs actually happily redirect to each other as needed. Annoyingly, these are blocked now, so autoimporting them from Wikidata always needs manual fixups.
The only thing that OpenLibrary seems to actually care about is the ID itself. Luckily, the end of each ID specifies what kind of URL this is supposed to be, so we should be able to turn all OL[0-9]+A IDs into author links, OL[0-9]+M into book links and OL[0-9]+W into work links.
Publishers are different and should still be kept as-is, but we already clean that up separately anyway. Amusingly, they still accept and redirect a link such as https://openlibrary.org/publishers/OL4480676A but I haven't seen one in the wild.