Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Gets a 301 response for each attempted download #70

Closed
mikeCalvir opened this issue Feb 17, 2020 · 3 comments
Closed

Gets a 301 response for each attempted download #70

mikeCalvir opened this issue Feb 17, 2020 · 3 comments
Assignees

Comments

@mikeCalvir
Copy link

I just tried this and it looks like all of the docs listed in the repo have been moved...

% curl https://api.github.com/repositories/72685026/contents/articles | jq -r '.[] | select(.type | contains("dir")) | "https://docs.microsoft.com/pdfstore/Azure.azure-documents/live/\(.name).pdf"' | wget -i -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162k 100 162k 0 0 183k 0 --:--:-- --:--:-- --:--:-- 182k
--2020-02-17 22:39:12-- https://docs.microsoft.com/pdfstore/Azure.azure-documents/live/active-directory-b2c.pdf
Resolving docs.microsoft.com (docs.microsoft.com)... 2.21.208.15
Connecting to docs.microsoft.com (docs.microsoft.com)|2.21.208.15|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://opbuildstorageprod.blob.core.windows.net/output-pdf-files/Azure.azure-documents/live/active-directory-b2c.pdf [following]
--2020-02-17 22:39:12-- https://opbuildstorageprod.blob.core.windows.net/output-pdf-files/Azure.azure-documents/live/active-directory-b2c.pdf
Resolving opbuildstorageprod.blob.core.windows.net (opbuildstorageprod.blob.core.windows.net)... 40.112.152.16
Connecting to opbuildstorageprod.blob.core.windows.net (opbuildstorageprod.blob.core.windows.net)|40.112.152.16|:443... connected.
HTTP request sent, awaiting response... 404 The specified resource does not exist.
2020-02-17 22:39:13 ERROR 404: The specified resource does not exist..

--2020-02-17 22:39:13-- https://docs.microsoft.com/pdfstore/Azure.azure-documents/live/active-directory-domain-services.pdf
Connecting to docs.microsoft.com (docs.microsoft.com)|2.21.208.15|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://opbuildstorageprod.blob.core.windows.net/output-pdf-files/Azure.azure-documents/live/active-directory-domain-services.pdf [following]

I only wanted a couple anyway so I'll look for those, but I thought I'd let you know :)

@mbcrump
Copy link
Contributor

mbcrump commented Feb 25, 2020

@mikeCalvir try this one:

for row in $(curl https://api.github.com/repositories/72685026/contents/articles | jq -c -r '.[] | select(.type | contains("dir")) | "\(.name)"'); do wget -O "${row}.pdf" "https://docs.microsoft.com/en-us/azure/opbuildpdf/${row}/toc.pdf?branch=live"; done

LMK if that is correct. If so can you submit a PR for tip 128 with this info in it?

@mikeCalvir
Copy link
Author

Thanks @mbcrump, that's running now and looking much better :)

@mikeCalvir
Copy link
Author

Forked, changed and PR submitted. Hmm I didn't reference this issue though! Oh well hopefully useful, thanks for the fix :)

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

No branches or pull requests

2 participants