Jump to content




[0.1] gh-dl - a GitHub downloader


  • You cannot reply to this topic
6 replies to this topic

#1 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 07 May 2013 - 09:05 AM

gh-dl - a GitHub downloader

I just found an API for GitHub, and how you can use it, and since it was very easy to use I decided to make a GitHub downloader. It's very easy, and has no ui, but it does what it has to.

It's in Beta, and I'll add an possibility to download file trees later. The biggest problem is, that the GitHub API has a access limit, you can only access the API 60 times per hour, so downloading

a repo with more than 60 files would be a bit... problematic :/ But I think I could set up a central server that could get an API access upgrade (You have to ask GitHub to get such an upgrade, then you can send 5000 API requests per hour :3) and redirect the requests to access the GitHub API to the central server.


Changelog
Spoiler

Download
pastebin.com/tcY3cJnn
or
pastebin get tcY3cJnn gh-dl


#2 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 07 May 2013 - 10:47 AM

People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.

#3 superaxander

  • Members
  • 609 posts
  • LocationHolland

Posted 07 May 2013 - 10:51 AM

This is prettig good!

#4 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 07 May 2013 - 12:58 PM

View PostSammich Lord, on 07 May 2013 - 10:47 AM, said:

People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.
I didn't know that there was a way to download the files using the raw subdomain of github. I tried to use it, but it seems that you can't list files in a directory. If it works, I'll use that and not the API of course. (PS: It throws an 404 error if I try to list a dir)


View Postsuperaxander, on 07 May 2013 - 10:51 AM, said:

This is prettig good!
Thanks :)

#5 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 07 May 2013 - 01:08 PM

View Postardera, on 07 May 2013 - 12:58 PM, said:

View PostSammich Lord, on 07 May 2013 - 10:47 AM, said:

People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.
I didn't know that there was a way to download the files using the raw subdomain of github. I tried to use it, but it seems that you can't list files in a directory. If it works, I'll use that and not the API of course. (PS: It throws an 404 error if I try to list a dir)


Yup. Just use raw.github.com/username/project/branch/file. Like this:
https://raw.github.com/AliquotMesozoic/Lunar/master/lunar
I don't believe you can list a directory contents though using raw, so that's a downside.

#6 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 07 May 2013 - 01:26 PM

View PostBubba, on 07 May 2013 - 01:08 PM, said:

-snip-
I don't believe you can list a directory contents though using raw, so that's a downside.

Yep, thats what I meant, but I think I can make it "hybrid", so that it uses raw.github.com to download the files and api.github.com to list the directories.

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 May 2013 - 05:01 PM

View Postardera, on 07 May 2013 - 01:26 PM, said:

View PostBubba, on 07 May 2013 - 01:08 PM, said:

-snip-
I don't believe you can list a directory contents though using raw, so that's a downside.

Yep, thats what I meant, but I think I can make it "hybrid", so that it uses raw.github.com to download the files and api.github.com to list the directories.

Yeah, that API and raw combination is what my package manager project (cc-packman on my github) uses to fetch an entire repo. I'm not sure why you would want to use just one or the other.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users