-
Notifications
You must be signed in to change notification settings - Fork 2
[ 🧹 ] Editorconfig , Querystring Replacement , Shorter Test Video #9
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
Open
PhoneDroid
wants to merge
4
commits into
DjDeveloperr:main
Choose a base branch
from
PhoneDroid:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| ################################################################################ | ||
| # # | ||
| # Editorconfig # | ||
| # # | ||
| # This file defines basic file properties that # | ||
| # editors / IDEs use when you modify documents. # | ||
| # # | ||
| # Check https://EditorConfig.org for details. # | ||
| # # | ||
| ################################################################################ | ||
|
|
||
|
|
||
| root = true | ||
|
|
||
|
|
||
| [*] | ||
|
|
||
| end_of_line = lf | ||
|
|
||
| [LICENSE] | ||
| [*.{editorconfig,gitignore,json,ts,md}] | ||
|
|
||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 4 | ||
| charset = utf-8 | ||
|
|
||
|
|
||
| [*.md] | ||
|
|
||
| trim_trailing_whitespace = false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .vscode | ||
| video.mp4 | ||
| music.mp3 | ||
| audio.mp3 | ||
| .vscode | ||
| video.mp4 | ||
| music.mp3 | ||
| audio.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Copyright 2021 DjDeveloperr | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
| Copyright 2021 DjDeveloperr | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,26 @@ | ||
| # ytdl_core | ||
| Deno port of [ytdl-core](https://www.npmjs.com/package/ytdl-core) using Web Streams API. | ||
| ## Usage | ||
| ```ts | ||
| import ytdl from "https://deno.land/x/ytdl_core/mod.ts"; | ||
| const stream = await ytdl("vRXZj0DzXIA"); | ||
| const chunks: Uint8Array[] = []; | ||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
| const blob = new Blob(chunks); | ||
| await Deno.writeFile("video.mp4", new Uint8Array(await blob.arrayBuffer())); | ||
| ``` | ||
| ## License | ||
| Check [License](./LICENSE) for more info. | ||
| Copyright 2021 DjDeveloper, Copyright (C) 2012-present by fent | ||
| # ytdl_core | ||
|
|
||
| Deno port of [ytdl-core](https://www.npmjs.com/package/ytdl-core) using Web Streams API. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```ts | ||
| import ytdl from "https://deno.land/x/ytdl_core/mod.ts"; | ||
|
|
||
| const stream = await ytdl("vRXZj0DzXIA"); | ||
|
|
||
| const chunks: Uint8Array[] = []; | ||
|
|
||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
|
|
||
| const blob = new Blob(chunks); | ||
| await Deno.writeFile("video.mp4", new Uint8Array(await blob.arrayBuffer())); | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Check [License](./LICENSE) for more info. | ||
|
|
||
| Copyright 2021 DjDeveloper, Copyright (C) 2012-present by fent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| export {default as querystring} from "https://esm.sh/querystring@0.2.1"; | ||
| export { humanStr as parseTimestamp } from "https://raw.githubusercontent.com/fent/node-m3u8stream/master/src/parse-time.ts"; | ||
| export * as sax from "https://deno.land/x/sax_ts@v1.2.10/src/sax.ts"; | ||
| export { default as m3u8stream } from "https://esm.sh/m3u8stream@0.8.6"; | ||
| export { humanStr as parseTimestamp } from "https://raw.githubusercontent.com/fent/node-m3u8stream/master/src/parse-time.ts"; | ||
| export * as sax from "https://deno.land/x/sax_ts@v1.2.10/src/sax.ts"; | ||
| export { default as m3u8stream } from "https://esm.sh/m3u8stream@0.8.6"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| export * from "./src/cache.ts"; | ||
| export * from "./src/format_util.ts"; | ||
| export * from "./src/formats.ts"; | ||
| export * from "./src/info.ts"; | ||
| export * from "./src/info_extras.ts"; | ||
| export * from "./src/url_utils.ts"; | ||
| export { | ||
| decipherFormats, | ||
| setDownloadURL, | ||
| cache as sigCache, | ||
| } from "./src/sig.ts"; | ||
| export * from "./src/utils.ts"; | ||
| export * from "./src/stream.ts"; | ||
| export * from "./src/video.ts"; | ||
| export { ytdl as default } from "./src/video.ts"; | ||
| export * from "./src/cache.ts"; | ||
| export * from "./src/format_util.ts"; | ||
| export * from "./src/formats.ts"; | ||
| export * from "./src/info.ts"; | ||
| export * from "./src/info_extras.ts"; | ||
| export * from "./src/url_utils.ts"; | ||
| export { | ||
| decipherFormats, | ||
| setDownloadURL, | ||
| cache as sigCache, | ||
| } from "./src/sig.ts"; | ||
| export * from "./src/utils.ts"; | ||
| export * from "./src/stream.ts"; | ||
| export * from "./src/video.ts"; | ||
| export { ytdl as default } from "./src/video.ts"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,58 @@ | ||
| export class Cache extends Map { | ||
| constructor(public timeout = 1000) { | ||
| super(); | ||
| } | ||
| set(key: string, value: any) { | ||
| if (this.has(key)) { | ||
| clearTimeout(super.get(key).tid); | ||
| } | ||
| super.set(key, { | ||
| tid: setTimeout(this.delete.bind(this, key), this.timeout), | ||
| value, | ||
| }); | ||
| return this; | ||
| } | ||
| get(key: string) { | ||
| let entry = super.get(key); | ||
| if (entry) { | ||
| return entry.value; | ||
| } | ||
| return null; | ||
| } | ||
| getOrSet(key: string, fn: CallableFunction) { | ||
| if (this.has(key)) { | ||
| return this.get(key); | ||
| } else { | ||
| let value = fn(); | ||
| this.set(key, value); | ||
| (async () => { | ||
| try { | ||
| await value; | ||
| } catch (err) { | ||
| this.delete(key); | ||
| } | ||
| })(); | ||
| return value; | ||
| } | ||
| } | ||
| delete(key: string) { | ||
| let entry = super.get(key); | ||
| if (entry) { | ||
| clearTimeout(entry.tid); | ||
| return super.delete(key); | ||
| } else return false; | ||
| } | ||
| clear() { | ||
| for (let entry of this.values()) { | ||
| clearTimeout(entry.tid); | ||
| } | ||
| super.clear(); | ||
| } | ||
| } | ||
| export class Cache extends Map { | ||
| constructor(public timeout = 1000) { | ||
| super(); | ||
| } | ||
|
|
||
| set(key: string, value: any) { | ||
| if (this.has(key)) { | ||
| clearTimeout(super.get(key).tid); | ||
| } | ||
|
|
||
| super.set(key, { | ||
| tid: setTimeout(this.delete.bind(this, key), this.timeout), | ||
| value, | ||
| }); | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| get(key: string) { | ||
| let entry = super.get(key); | ||
| if (entry) { | ||
| return entry.value; | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| getOrSet(key: string, fn: CallableFunction) { | ||
| if (this.has(key)) { | ||
| return this.get(key); | ||
| } else { | ||
| let value = fn(); | ||
| this.set(key, value); | ||
| (async () => { | ||
| try { | ||
| await value; | ||
| } catch (err) { | ||
| this.delete(key); | ||
| } | ||
| })(); | ||
| return value; | ||
| } | ||
| } | ||
|
|
||
| delete(key: string) { | ||
| let entry = super.get(key); | ||
| if (entry) { | ||
| clearTimeout(entry.tid); | ||
| return super.delete(key); | ||
| } else return false; | ||
| } | ||
|
|
||
| clear() { | ||
| for (let entry of this.values()) { | ||
| clearTimeout(entry.tid); | ||
| } | ||
| super.clear(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this instead? I think the comment at top is unnecessary and the ident size should be 2.