Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Sync upstream (b04c204)
  • Loading branch information
Sticks committed Sep 16, 2024
1 parent 36bb82c commit d6092eb
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 14 deletions.
123 changes: 122 additions & 1 deletion README.md
@@ -1 +1,122 @@
# Video-Downloader
<div align="center">
<br/>
<p>
<img src="web/static/favicon.png" title="cobalt" alt="cobalt logo" width="100" />
</p>
<p>
best way to save what you love
<br/>
<a href="https://cobalt.tools">
cobalt.tools
</a>
</p>
<p>
<a href="https://discord.gg/pQPt8HBUPu">
💬 community discord server
</a>
<a href="https://x.com/justusecobalt">
🐦 twitter/x
</a>
</p>
<br/>
</div>

cobalt is a media downloader that doesn't piss you off. it's fast, friendly, and doesn't have any bullshit that modern web is filled with: ***no ads, trackers, or paywalls***.

paste the link, get the file, move on. it's that simple. just how it should be.

### supported services
this list is not final and keeps expanding over time. if support for a service you want is missing, create an issue (or a pull request 👀).

| service | video + audio | only audio | only video | metadata | rich file names |
| :-------- | :-----------: | :--------: | :--------: | :------: | :-------------: |
| bilibili ||||||
| bluesky ||||||
| dailymotion ||||||
| instagram ||||||
| facebook ||||||
| loom ||||||
| ok.ru ||||||
| pinterest ||||||
| reddit ||||||
| rutube ||||||
| snapchat ||||||
| soundcloud ||||||
| streamable ||||||
| tiktok ||||||
| tumblr ||||||
| twitch clips ||||||
| twitter/x ||||||
| vimeo ||||||
| vine ||||||
| vk videos & clips ||||||
| youtube ||||||

| emoji | meaning |
| :-----: | :---------------------- |
|| supported |
|| impossible/unreasonable |
|| not supported |

### additional notes or features (per service)
| service | notes or features |
| :-------- | :----- |
| instagram | supports reels, photos, and videos. lets you pick what to save from multi-media posts. |
| facebook | supports public accessible videos content only. |
| pinterest | supports photos, gifs, videos and stories. |
| reddit | supports gifs and videos. |
| snapchat | supports spotlights and stories. lets you pick what to save from stories. |
| rutube | supports yappy & private links. |
| soundcloud | supports private links. |
| tiktok | supports videos with or without watermark, images from slideshow without watermark, and full (original) audios. |
| twitter/x | lets you pick what to save from multi-media posts. may not be 100% reliable due to current management. |
| vimeo | audio downloads are only available for dash. |
| youtube | supports videos, music, and shorts. 8K, 4K, HDR, VR, and high FPS videos. rich metadata & dubs. h264/av1/vp9 codecs. |

### partners
cobalt is sponsored by [royalehosting.net](https://royalehosting.net/?partner=cobalt), all main instances are currently hosted on their network :)

### ethics and disclaimer
cobalt is a tool for easing content downloads from internet and takes ***zero liability***. you are responsible for what you download, how you use and distribute that content. please be mindful when using content of others and always credit original creators. fair use and credits benefit everyone.

cobalt is ***NOT*** a piracy tool and cannot be used as such. it can only download free, publicly accessible content. such content can be easily downloaded through any browser's dev tools. pressing one button is easier, so i made a convenient, ad-less tool for such repeated actions.

### cobalt license
for relevant licensing information, see the [api](api/README.md) and [web](web/README.md) READMEs.
unless specified otherwise, the remainder of this repository is licensed under [AGPL-3.0](LICENSE).

## acknowledgements
### ffmpeg
cobalt heavily relies on ffmpeg for converting and merging media files. it's an absolutely amazing piece of software offered for anyone for free, yet doesn't receive as much credit as it should.

you can [support ffmpeg here](https://ffmpeg.org/donations.html)!

#### ffmpeg-static
we use [ffmpeg-static](https://github.com/eugeneware/ffmpeg-static) to get binaries for ffmpeg depending on the platform.

you can support the developer via various methods listed on their github page! (linked above)

### youtube.js
cobalt relies on [youtube.js](https://github.com/LuanRT/YouTube.js) for interacting with the innertube api, it wouldn't have been possible without it.

you can support the developer via various methods listed on their github page! (linked above)

### many others
cobalt also depends on:

- [content-disposition-header](https://www.npmjs.com/package/content-disposition-header) to simplify the provision of `content-disposition` headers.
- [cors](https://www.npmjs.com/package/cors) to manage cross-origin resource sharing within expressjs.
- [dotenv](https://www.npmjs.com/package/dotenv) to load environment variables from the `.env` file.
- [esbuild](https://www.npmjs.com/package/esbuild) to minify the frontend files.
- [express](https://www.npmjs.com/package/express) as the backbone of cobalt servers.
- [express-rate-limit](https://www.npmjs.com/package/express-rate-limit) to rate limit api endpoints.
- [hls-parser](https://www.npmjs.com/package/hls-parser) to parse `m3u8` playlists for certain services.
- [ipaddr.js](https://www.npmjs.com/package/ipaddr.js) to parse ip addresses (for rate limiting).
- [nanoid](https://www.npmjs.com/package/nanoid) to generate unique (temporary) identifiers for each requested stream.
- [node-cache](https://www.npmjs.com/package/node-cache) to cache stream info in server ram for a limited amount of time.
- [psl](https://www.npmjs.com/package/psl) as the domain name parser.
- [set-cookie-parser](https://www.npmjs.com/package/set-cookie-parser) to parse cookies that cobalt receives from certain services.
- [undici](https://www.npmjs.com/package/undici) for making http requests.
- [url-pattern](https://www.npmjs.com/package/url-pattern) to match provided links with supported patterns.

...and many other packages that these packages rely on.
4 changes: 2 additions & 2 deletions api/src/util/setup.js
@@ -1,7 +1,7 @@
import { existsSync, unlinkSync, appendFileSync } from "fs";
import { createInterface } from "readline";
import { Cyan, Bright } from "./misc/console-text.js";
import { loadJSON } from "./misc/load-from-fs.js";
import { Cyan, Bright } from "../misc/console-text.js";
import { loadJSON } from "../misc/load-from-fs.js";
import { execSync } from "child_process";

const { version } = loadJSON("./package.json");
Expand Down
1 change: 1 addition & 0 deletions packages/api-client/.gitignore
@@ -0,0 +1 @@
dist
4 changes: 2 additions & 2 deletions web/i18n/en/settings.json
Expand Up @@ -65,7 +65,7 @@
"metadata.filename.basic": "basic",
"metadata.filename.pretty": "pretty",
"metadata.filename.nerdy": "nerdy",
"metadata.filename.description": "filename style will only be used for files tunnelled by cobalt. some services don't support filename styles other than classic.",
"metadata.filename.description": "filename style will only be used for files tunneled by cobalt. some services don't support filename styles other than classic.",

"metadata.filename.preview.video": "Video Title",
"metadata.filename.preview.audio": "Audio Title - Audio Author",
Expand Down Expand Up @@ -98,7 +98,7 @@
"privacy.analytics.description": "anonymous traffic analytics are needed to get an approximate number of active cobalt users. no identifiable information about you is ever stored. all processed data is anonymized and aggregated.\n\nwe use a self-hosted plausible instance that doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR.",
"privacy.analytics.learnmore": "learn more about plausible's dedication to privacy.",

"privacy.tunnel": "tunnelling",
"privacy.tunnel": "tunneling",
"privacy.tunnel.title": "always tunnel files",
"privacy.tunnel.description": "cobalt will hide your ip address, browser info, and bypass local network restrictions. when enabled, files will also have readable filenames that otherwise would be gibberish.",

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/donate/DonateShareCard.svelte
Expand Up @@ -59,7 +59,7 @@
<div class="action-button-icon">
<CopyIcon check={copied} />
</div>
copy
{$t("button.copy")}
</button>

{#if device.supports.share}
Expand Down
10 changes: 5 additions & 5 deletions web/src/components/settings/LanguageDropdown.svelte
@@ -1,5 +1,4 @@
<script lang="ts">
import locale from "$lib/i18n/locale";
import languages from "$i18n/languages.json";
import { t, locales } from "$lib/i18n/translations";
Expand All @@ -10,10 +9,12 @@
$: currentSetting = $settings.appearance.language;
$: disabled = $settings.appearance.autoLanguage;
const updateLocale = (lang: string) => {
const updateLocale = (event: Event) => {
const target = event.target as HTMLSelectElement;
updateSetting({
appearance: {
language: lang as keyof typeof languages,
language: target.value as keyof typeof languages,
},
});
};
Expand All @@ -34,8 +35,7 @@
</div>
<select
id="setting-dropdown-appearance-language"
bind:value={$locale}
on:change={() => updateLocale($locale)}
on:change={updateLocale}
{disabled}
>
{#each $locales as value}
Expand Down
6 changes: 5 additions & 1 deletion web/src/lib/i18n/translations.ts
Expand Up @@ -7,7 +7,7 @@ import type {
LocalizationContent
} from '$lib/types/i18n';

import languages from '$i18n/languages.json';
import _languages from '$i18n/languages.json';

const locFiles = import.meta.glob('$i18n/*/**/*.json');
const parsedLocfiles: StructuredLocfileInfo = {};
Expand All @@ -22,6 +22,8 @@ for (const [path, loader] of Object.entries(locFiles)) {
}

const defaultLocale = 'en';
const languages: Record<string, string> = _languages;

const config: Config<{
value?: string;
formats?: string;
Expand All @@ -30,6 +32,8 @@ const config: Config<{
}> = {
fallbackLocale: defaultLocale,
translations: Object.keys(parsedLocfiles).reduce((obj, lang) => {
languages[lang] ??= `${lang} (missing name)`;

return {
...obj,
[lang]: { languages }
Expand Down
4 changes: 2 additions & 2 deletions web/src/routes/about/privacy/+page.svelte
Expand Up @@ -25,10 +25,10 @@
<section id="saving">
<h3>saving</h3>
<p>
when using saving functionality, in some cases cobalt will encrypt & temporarily store information needed for tunnelling. it's stored in processing server's RAM for 90 seconds and irreversibly purged afterwards. no one has access to it, even instance owners, as long as they don't modify the official cobalt image.
when using saving functionality, in some cases cobalt will encrypt & temporarily store information needed for tunneling. it's stored in processing server's RAM for 90 seconds and irreversibly purged afterwards. no one has access to it, even instance owners, as long as they don't modify the official cobalt image.
</p>
<p>
processed/tunnelled files are never cached anywhere. everything is tunnelled live. cobalt's saving functionality is essentially a fancy proxy service.
processed/tunneled files are never cached anywhere. everything is tunneled live. cobalt's saving functionality is essentially a fancy proxy service.
</p>
</section>

Expand Down

0 comments on commit d6092eb

Please sign in to comment.