GithubHelp home page GithubHelp logo

download-directory / download-directory.github.io Goto Github PK

View Code? Open in Web Editor NEW
1.0K 13.0 99.0 396 KB

Web App: Download just a sub directory from a GitHub repo.

Home Page: https://download-directory.github.io

License: MIT License

HTML 26.15% CSS 23.97% JavaScript 49.89%
github tool downloader javacript git webapp

download-directory.github.io's Introduction

download-directory.github.io

Download just a sub directory from a GitHub repo

GitHub doesn’t let you download a single folder from a repo, which might be necessary when you just need a few files from a large repository.

This tool will handle the download of all the files in a directory, in a single click, after you entered your token.

The download starts automatically when you visit pass the link to the GitHub directory as url parameter, like:

download-directory.github.io?url=https://github.com/mrdoob/three.js/tree/dev/build

This is an alternative to the existing GitZip and DownGit but without the cruft.

Related

License

MIT © Federico Brigante

download-directory.github.io's People

Contributors

aayush9029 avatar aslafy-z avatar foxrefire avatar fregante avatar friendly-banana avatar ironicnet avatar kidonng avatar loilo avatar renovate[bot] avatar tsuk1ko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

download-directory.github.io's Issues

Token through query param is deprecated

Hi,
Github just sent me this, I thought you should be aware of that.

Thanks for your amazing work.

Hi @mathieutu,

On March 29th, 2020 at 17:24 (UTC) your personal access token (Download GitHub directory) using Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0 was used as part of a query parameter to access an endpoint through the GitHub API:

https://api.github.com/repositories/****/git/trees/master

Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation.

Depending on your API usage, we'll be sending you this email reminder on a monthly basis for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates.

Thanks,
The GitHub Team

Filenames with spaces

After regenerating a new token for download-directory, I tried to download a directory from a repository, but it seems to download any files.

Screenshot

When I try to unzip the file, since there wasn't files inside, it shows a warning

Warning

I checked multiple times: 😂there were files on the repo!

  • Is there any way to solve this?
  • Is this issue caused by a wrong setup of Github token?
  • Is this even a valid issue, or am I just doing it wrong?

Add `url` form field on page

Currently it's only available via url parameter, but getting it there should be easy:

  1. Append this to line 10 in the JS file
<form><input name="url" placeholder="URL to folder on GitHub.com"></form>
  1. Add CSS to make it smaller

Repeating a download after invalidating the originally used token

I (foolishly) didn't keep a note of my first ever token, which I used at https://download-directory.github.io/?url=https://github.com/QWERTYUIOPYOZO/ReFont/tree/master/src in Waterfox. The original token no longer exists.

Now whenever I aim to repeat that download, I get just this:

2018-03-25 11 19 03

– not progressing to a download.

When I click token, a more recently generated token is not accepted (AFAIR the bullets, in the field, appear red).

As a workaround I can visit https://download-directory.github.io/?url=https://github.com/QWERTYUIOPYOZO/ReFont/tree/master/src in Firefox but I'm puzzling about how I can get it to work, again, in Waterfox.

Any suggestions?

(I already toyed with removal of cookies.)

TIA

Serve tar.gz from server

please in tar.gz and direct download not webpage loading

for use with wget and auto generate linux packaging

zip format is not compatibility for linux packaging

tank you

Use a smaller archiver

https://github.com/Stuk/jszip is huge (170KB) so maybe try https://github.com/beatgammit/tar-js?

Edit: I tried tar-js but it takes a loooot longer to build the archive.

Tested code
	const requests = await Promise.all(files.map(async path => {
		const response = await fetch(`https://raw.githubusercontent.com/${repo}/${branch}/${path}`);
		const blob = await response.arrayBuffer();

		downloaded++;
		updateStatus(files.length, downloaded);
		console.log('Downloaded:', path);

		return {path, blob};
	}));
	console.log('Downloaded', files.length, 'files');

	const tar = new Tar();
	for (const file of requests) {
		tar.append(file.path.replace(dir + '/', ''), new Uint8Array(file.blob));
	}

	saveFile(tar, `${repo} ${dir}.tar`.replace(/\//, '-'), () => {
		updateStatus(files.length, downloaded, true);
		console.log('Done!');
	});

Edit: maybe https://github.com/thejoshwolfe/yazl

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>fregante/.github:renovate-preset)

RangeError: offset is out of bounds

After outputting in the console "Zipping X files…"

If trows this exceptions and does not download anything:

UZIP.js:187 Uncaught (in promise) RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at f._writeHeader (UZIP.js:187:12)
    at f.encode (UZIP.js:136:12)
    at index.js:192:26

Console errors on load

It still works, but I think the service worker is broken.

[Log]  (download-directory.github.io.9f7dde0d.js, line 31)
[Error] ReferenceError: Can't find variable: parcelRequire
	(anonymous function) (download-directory.github.io.9f7dde0d.js:1:1003)
	Module Code (download-directory.github.io.9f7dde0d.js:1:1024)
	evaluate
	moduleEvaluation
	(anonymous function)
	promiseReactionJob
[Info] Successfully preconnected to https://fonts.gstatic.com/
[Error] TypeError: Type error
	URL (download-directory.github.io.9f7dde0d.js:31:3505)
	(anonymous function) (download-directory.github.io.9f7dde0d.js:31:3505)
[Error] Failed to load resource: the server responded with a status of 404 () (favicon.ico, line 0)

CRLF in files are being converted to LF only

Description:

When attempting to download a folder from the website, all text files with CRLF line endings are being automatically converted to LF, causing line-ending inconsistencies in the downloaded files.

Steps to Reproduce:

Download a folder using the web tool
Navigate to a folder containing text files with CRLF line endings.
Check the line endings.

Expected Behavior:

The downloaded files should retain their original CRLF line endings as they exist in the repository.

Actual Behavior:

After downloading, the line endings in text files are converted to LF, deviating from the original CRLF line endings.

Additional Information:

This issue is affecting all contributors who download folders on github repositories.
It impacts the consistency of line endings in text files, which can be problematic for cross-platform development.

Workarounds:

Manually converting line endings back to CRLF using a text editor like Notepad++ or Visual Studio Code with the "Change End Of Line Sequence" feature.

Possible Cause:

This issue might be related to Git configuration settings or Git clients auto-converting line endings on Windows systems.

Reproducibility:

This issue is reproducible consistently when downloading folders containing text files with CRLF line endings.

Support private repos

  1. token instructions don't include private repos
  2. if enabled, files are still fetched without token, so they 404

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
.github/workflows/deployment.yml
  • actions/checkout v3
  • crazy-max/ghaction-github-pages v3
npm
package.json
  • jszip ^3.10.0
  • list-github-dir-content ^3.0.0
  • p-map ^5.5.0
  • p-retry ^5.1.1
  • save-file ^2.3.1
  • buffer ^6.0.3
  • parcel ^2.6.2
  • parcel-resolver-ignore ^2.1.3
  • process ^0.11.10
  • xo ^0.50.0

  • Check this box to trigger a request for Renovate to run again on this repository

Can we re-use your code for our open-source community?

Hey @fregante, fantastic work!

I help manage an open-source community of over 1,300 active contributors with pretty large repos.

We'd love to give our community the ability to download only the subfolders they need, but we'd prefer to not overload your site with extra traffic.

I saw that your code is MIT-licensed, but I wanted to ask for your permission to use your code in our community website -- while making sure to give you credit, of course.

If so, do you have any recommendations on how to get started?

Redirect to native zip URL when pasting a link to a branch, commit or tag

For example:

https://github.com/fregante/webext-domain-permission-toggle
https://github.com/fregante/webext-domain-permission-toggle/tree/main
https://github.com/fregante/webext-domain-permission-toggle/tree/v3.0.0
https://github.com/fregante/webext-domain-permission-toggle/tree/e125b40129e53342bc6ac07a1afc29696da347a4

Should just point to

https://github.com/fregante/webext-domain-permission-toggle/archive/refs/heads/main.zip
https://github.com/fregante/webext-domain-permission-toggle/archive/refs/tags/v3.0.0.zip
https://github.com/fregante/webext-domain-permission-toggle/archive/e125b40129e53342bc6ac07a1afc29696da347a4.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.