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

How to use DownGit with wget or curl? #42

Open
sugatoray opened this issue Apr 11, 2021 · 8 comments
Open

How to use DownGit with wget or curl? #42

sugatoray opened this issue Apr 11, 2021 · 8 comments

Comments

@sugatoray
Copy link

How to use DownGit generated URL with wget or curl? Since the url does not have any file extension, it creates an index.html file. Also, is there any way that I can use DownGit generated URL in python to download the zipped file?

@MinhasKamal
Copy link
Owner

If you want to use wget, curl, or python, then you don't need DownGit. You can directly call GitHub API and download the files.

@sugatoray
Copy link
Author

sugatoray commented Jul 22, 2021

If you want to use wget, curl, or python, then you don't need DownGit. You can directly call GitHub API and download the files.

@MinhasKamal Could you please share an example code snippet for downloading a subdirectory of a github repo? Thank you.

@MinhasKamal
Copy link
Owner

MinhasKamal commented Jul 28, 2021

@sugatoray The code for downloading GitHub directories should be pretty straight-forward-

  1. take the GutHub directory link
  2. hit the GitHub API (manual- https://docs.github.com/en/rest)
  3. search through the directory and download all files

You will find many examples by Googling. Here is a python code I found- https://gist.github.com/pdashford/2e4bcd4fc2343e2fd03efe4da17f577d

@sugatoray
Copy link
Author

@MinhasKamal Thank you, for the examples. Much appreciated!

@sugatoray
Copy link
Author

@MinhasKamal Could you please activate the "discussion" tab, so if there are questions (which are not exactly issues), people can ask them under discussions? This will also keep the number of open issues low (hopefully).

I have another question for you: Is the following link also equivalent to appending a .zip at the end?

https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/sugatoray/latex-project-report-template

I was trying to use downgit to open any folder in overleaf.com using their api. I know that this works.

https://www.overleaf.com/docs?snip_uri=https://github.com/sugatoray/latex-project-report-template/archive/refs/heads/master.zip

API: https://www.overleaf.com/dev

However, I would like to use the path to any folder (not the just the entire branch). Any suggestions?

@MinhasKamal
Copy link
Owner

No, you cannot use DownGit for this purpose. https://github.com/sugatoray/latex-project-report-template/archive/refs/heads/master.zip is a direct file/resource link. For your purpose, you have to use DownGit, or implement something like it on a server-side.

I am actually an embedded-system developer, so my knowledge of web-app is very limited.

@sugatoray
Copy link
Author

@MinhasKamal Thank you, for the quick response.

@suntong
Copy link

suntong commented Sep 20, 2023

If you want to use wget, curl, or python, then you don't need DownGit. You can directly call GitHub API and download the files.

Hi MinhasKamal, would you explain a bit how the download link work please? I.e., since you're providing a download link functionality, why disabling wget, curl downloading? (I took a look at your suggested GitHub API & python code, they are much more complicated than using wget, curl to download from an url)

For my case, I don’t want to download to my local drive but need a download link to do the download in my remote VPS instead.

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

No branches or pull requests

3 participants