diff --git a/README.md b/README.md
index 30363a36..dafc15b2 100644
--- a/README.md
+++ b/README.md
@@ -13,19 +13,22 @@ cobalt is social media downloader with zero bullshit. It's friendly, accessible,
It preserves original media quality so you get best downloads possible (unless you change that in settings).
## Supported services
-| Service | Video + Audio | Only audio | Additional features |
-| -------- | :---: | :---: | :----- |
-| Twitter | ✅ | ✅ | Ability to save multiple videos/GIFs from a single tweet. |
-| Twitter Spaces | ❌️ | ✅ | Audio metadata. |
-| YouTube & Shorts | ✅ | ✅ | Support for 8K, 4K, HDR, and high FPS videos. |
-| YouTube Music | ❌ | ✅ | Audio metadata. |
-| Reddit | ✅ | ✅ | |
-| TikTok & douyin | ✅ | ✅ | Video downloads with or without watermark; image slideshow downloads without watermarks. |
-| SoundCloud | ❌ | ✅ | Audio metadata. |
-| bilibili.com | ✅ | ✅ | |
-| Tumblr | ✅ | ✅ | |
-| Vimeo | ✅ | ❌️ | |
-| VK Videos & Clips | ✅ | ❌️ | |
+| Service | Video + Audio | Only audio | Additional features |
+| -------- | :---: | :---: | :----- |
+| Twitter | ✅ | ✅ | Ability to save multiple videos/GIFs from a single tweet. |
+| Twitter Spaces | ❌️ | ✅ | Audio metadata. |
+| YouTube & Shorts | ✅ | ✅ | Support for 8K, 4K, HDR, and high FPS videos. |
+| YouTube Music | ❌ | ✅ | Audio metadata. |
+| Reddit | ✅ | ✅ | |
+| TikTok & douyin | ✅ | ✅ | Video downloads with or without watermark; image slideshow downloads without watermarks. |
+| SoundCloud | ❌ | ✅ | Audio metadata, downloads from private links |
+| bilibili.com | ✅ | ✅ | |
+| Tumblr | ✅ | ✅ | |
+| Vimeo | ✅ | ❌️ | |
+| VK Videos & Clips | ✅ | ❌️ | |
+
+## cobalt API
+cobalt has an open API that you can use for free. It's pretty straightforward in use, [check out the docs](https://github.com/wukko/cobalt/blob/current/docs/API.md) and see for yourself.
## How to contribute translations
You can translate cobalt to any language you want on [cobalt's crowdin](https://crowdin-co.wukko.me/). Feel free to ignore QA errors if you think you know better. If you don't see a language you want to translate cobalt to, open an issue, and I'll add it to crowdin.
diff --git a/docs/API.md b/docs/API.md
index dac2e573..7bbdd725 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -21,6 +21,7 @@ Response Body Type: ``application/json``
| isAudioOnly | boolean | ``true / false`` | ``false`` | |
| isNoTTWatermark | boolean | ``true / false`` | ``false`` | Changes whether downloaded TikTok & Douyin videos have watermarks. |
| isTTFullAudio | boolean | ``true / false`` | ``false`` | Enables download of original sound used in a TikTok video. |
+| isAudioMuted | boolean | ``true / false`` | ``false`` | Disables audio track in video downloads. |
### Response Body Variables
| key | type | variables |
@@ -44,12 +45,12 @@ Item type: ``object``
Content live render streaming endpoint.
### Request Query Variables
-| key | variables | description |
-|:----|:-----------------|:------------------------------------------------------------------------------------------------------------------------------|
-| p | ``1`` | Used for checking the rate limit. |
-| t | Stream UUID | Unique stream identificator by which cobalt finds stored stream info data. |
-| h | HMAC | Hashed combination of: (hashed) ip address, stream uuid, expiry timestamp, and service name. Used for verification of stream. |
-| e | Expiry timestamp | |
+| key | variables | description |
+|:----|:-----------------|:-------------------------------------------------------------------------------------------------------------------------------|
+| p | ``1`` | Used for checking the rate limit. |
+| t | Stream token | Unique stream identificator which is used for retrieving cached stream info data. |
+| h | HMAC | Hashed combination of: (hashed) ip address, stream token, expiry timestamp, and service name. Used for verification of stream. |
+| e | Expiry timestamp | |
## GET: ``/api/onDemand``
On-demand website element loading. Currently used only for older changelogs.
diff --git a/package.json b/package.json
index 70b996ff..52cfa031 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "cobalt",
"description": "save what you love",
- "version": "4.5",
+ "version": "4.7.3",
"author": "wukko",
"exports": "./src/cobalt.js",
"type": "module",
diff --git a/src/cobalt.js b/src/cobalt.js
index 5a0861e0..74004f91 100644
--- a/src/cobalt.js
+++ b/src/cobalt.js
@@ -10,12 +10,12 @@ import { appName, genericUserAgent, version, internetExplorerRedirect } from "./
import { getJSON } from "./modules/api.js";
import renderPage from "./modules/pageRender/page.js";
import { apiJSON, checkJSONPost, languageCode } from "./modules/sub/utils.js";
-import { Bright, Cyan } from "./modules/sub/consoleText.js";
+import { Bright, Cyan, Green, Red } from "./modules/sub/consoleText.js";
import stream from "./modules/stream/stream.js";
import loc from "./localization/manager.js";
import { buildFront } from "./modules/build.js";
import { changelogHistory } from "./modules/pageRender/onDemand.js";
-import { encrypt } from "./modules/sub/crypto.js";
+import { sha256 } from "./modules/sub/crypto.js";
const commitHash = shortCommit();
const app = express();
@@ -71,7 +71,7 @@ if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt &&
}));
app.post('/api/:type', cors({ origin: process.env.selfURL, optionsSuccessStatus: 200 }), async (req, res) => {
try {
- let ip = encrypt(req.header('x-forwarded-for') ? req.header('x-forwarded-for') : req.ip.replace('::ffff:', ''), process.env.streamSalt);
+ let ip = sha256(req.header('x-forwarded-for') ? req.header('x-forwarded-for') : req.ip.replace('::ffff:', ''), process.env.streamSalt);
switch (req.params.type) {
case 'json':
try {
@@ -101,31 +101,13 @@ if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt &&
res.status(500).json({ 'status': 'error', 'text': loc(languageCode(req), 'ErrorCantProcess') })
}
});
- app.get('/api/:type', cors({ origin: process.env.selfURL, optionsSuccessStatus: 200 }), async (req, res) => {
+ app.get('/api/:type', cors({ origin: process.env.selfURL, optionsSuccessStatus: 200 }), (req, res) => {
try {
- let ip = encrypt(req.header('x-forwarded-for') ? req.header('x-forwarded-for') : req.ip.replace('::ffff:', ''), process.env.streamSalt);
+ let ip = sha256(req.header('x-forwarded-for') ? req.header('x-forwarded-for') : req.ip.replace('::ffff:', ''), process.env.streamSalt);
switch (req.params.type) {
- // **
- // json GET method will be deprecated by 4.5! make sure to move your shortcuts to POST method.
- // **
case 'json':
- try {
- if (req.query.url && req.query.url.length < 150) {
- let chck = checkJSONPost({});
- chck["ip"] = ip;
- let j = await getJSON(req.query.url.trim(), languageCode(req), chck)
- res.status(j.status).json(j.body);
- } else {
- let j = apiJSON(3, { t: loc(languageCode(req), 'ErrorNoLink', process.env.selfURL) })
- res.status(j.status).json(j.body);
- }
- } catch (e) {
- res.status(500).json({ 'status': 'error', 'text': loc(languageCode(req), 'ErrorCantProcess') })
- }
+ res.status(405).json({ 'status': 'error', 'text': 'GET method for this request has been deprecated. see https://github.com/wukko/cobalt/blob/current/docs/API.md for up-to-date API documentation.' });
break;
- // **
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ will be removed soon ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- // **
case 'stream':
if (req.query.p) {
res.status(200).json({ "status": "continue" });
@@ -190,8 +172,9 @@ if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt &&
res.redirect('/')
});
app.listen(process.env.port, () => {
- console.log(`\n${Bright(`${appName} (${version})`)}\n\nURL: ${Cyan(`${process.env.selfURL}`)}\nPort: ${process.env.port}\nCurrent commit: ${Bright(`${commitHash}`)}\nStart time: ${Bright(Math.floor(new Date().getTime()))}\n`)
+ let startTime = new Date();
+ console.log(`\n${Cyan(appName)} ${Bright(`v.${version}-${commitHash}`)}\nStart time: ${Bright(`${startTime.toUTCString()} (${Math.floor(new Date().getTime())})`)}\n\nURL: ${Cyan(`${process.env.selfURL}`)}\nPort: ${process.env.port}\n`)
});
} else {
- console.log(`you can't run the server without generating a .env file. please run the setup script first: npm run setup`)
+ console.log(Red(`cobalt hasn't been configured yet or configuration is invalid.\n`) + Bright(`please run the setup script to fix this: `) + Green(`npm run setup`))
}
diff --git a/src/config.json b/src/config.json
index 98bdd3f6..2d800fe6 100644
--- a/src/config.json
+++ b/src/config.json
@@ -1,5 +1,5 @@
{
- "streamLifespan": 3600000,
+ "streamLifespan": 120000,
"maxVideoDuration": 7500000,
"maxAudioDuration": 7500000,
"genericUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
@@ -41,6 +41,9 @@
"10-31": "🎃",
"11-01": "🕯️",
"11-02": "🕯️",
+ "12-20": "🎄",
+ "12-21": "🎄",
+ "12-22": "🎄",
"12-23": "🎄",
"12-24": "🎄",
"12-25": "🎄",
@@ -56,7 +59,7 @@
"webm": ["-c:v", "copy", "-c:a", "copy"],
"mp4": ["-c:v", "copy", "-c:a", "copy", "-movflags", "faststart+frag_keyframe+empty_moov"],
"copy": ["-c:a", "copy"],
- "audio": ["-ar", "48000", "-ac", "2", "-b:a", "320k"],
+ "audio": ["-vn", "-ar", "48000", "-ac", "2", "-b:a", "320k"],
"m4a": ["-movflags", "frag_keyframe+empty_moov"]
}
}
diff --git a/src/front/cobalt.css b/src/front/cobalt.css
index a4068ada..fabb6ca5 100644
--- a/src/front/cobalt.css
+++ b/src/front/cobalt.css
@@ -72,13 +72,13 @@ a {
:focus-visible {
outline: var(--border-15);
}
-[type=checkbox] {
- margin-right: 0.8rem;
-}
[type="checkbox"] {
-webkit-appearance: none;
- margin-right: 0.8rem;
+ appearance: none;
+ margin-right: 1rem;
z-index: 0;
+ border: 0;
+ height: 15px;
}
[type="checkbox"]::before {
content: "";
@@ -91,9 +91,12 @@ a {
position: relative;
}
[type="checkbox"]:checked::before {
- box-shadow: inset 0 0 0 0.2rem var(--accent-button-bg);
+ box-shadow: inset 0 0 0 0.14rem var(--accent-button-bg);
background-color: var(--accent);
}
+.checkbox span {
+ margin-top: 0.21rem;
+}
button {
background: none;
border: none;
@@ -278,9 +281,9 @@ input[type="checkbox"] {
height: auto;
width: 32%;
z-index: 999;
- padding: 3rem 2rem 2rem 2rem;
+ padding: 2rem;
font-size: 0.9rem;
- max-height: 80%;
+ max-height: 85%;
}
.popup.small {
width: 20%
@@ -296,7 +299,7 @@ input[type="checkbox"] {
z-index: 998;
}
.popup.scrollable {
- height: 80%;
+ height: 85%;
}
.scrollable .bottom-link {
padding-bottom: 2rem;
@@ -378,6 +381,7 @@ input[type="checkbox"] {
position: relative;
background: var(--background);
z-index: 999;
+ padding-top: 0.8rem;
}
#popup-content.with-footer {
margin-bottom: 3rem;
@@ -421,7 +425,7 @@ input[type="checkbox"] {
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
- padding: 0.6rem 1rem 0.6rem 0.6rem;
+ padding: 0.55rem 1rem 0.8rem 0.7rem;
width: auto;
margin: 0 0.5rem 0.5rem 0;
background: var(--accent-button-bg);
@@ -454,7 +458,7 @@ input[type="checkbox"] {
color: var(--accent-unhover-2);
}
.switch {
- padding: 0.8rem;
+ padding: 0.7rem;
width: 100%;
text-align: center;
color: var(--accent);
@@ -479,6 +483,7 @@ input[type="checkbox"] {
flex-direction: row;
flex-wrap: nowrap;
overflow-x: scroll;
+ scrollbar-width: none;
}
.autowidth {
width: auto;
@@ -493,7 +498,7 @@ input[type="checkbox"] {
overflow: auto;
}
#close-bottom {
- max-width: 3rem;
+ max-width: 2.8rem;
margin-left: 1rem;
background: var(--background);
border: var(--border-15);
@@ -509,6 +514,9 @@ input[type="checkbox"] {
position: relative;
width: 100%;
}
+.popup-tabs {
+ margin-top: 0.8rem;
+}
.emoji {
margin-right: 0.4rem;
}
@@ -573,9 +581,6 @@ input[type="checkbox"] {
margin-top: 0!important;
margin-bottom: 1rem;
}
-.popup-tabs {
- padding-top: 0.5rem;
-}
/* adapt the page according to screen size */
@media screen and (min-width: 2300px) {
html {
@@ -717,7 +722,7 @@ input[type="checkbox"] {
width: 100%!important;
}
#footer {
- bottom: 2rem;
+ bottom: 1.7rem;
transform: translate(-50%, 0%);
}
#footer-buttons {
@@ -727,6 +732,12 @@ input[type="checkbox"] {
.footer-pair .footer-button {
width: 100%!important;
}
+ #popup-header {
+ padding-top: 1.2rem;
+ }
+ #popup-settings #popup-header {
+ padding-top: 0.8rem;
+ }
.picker-image-container {
height: 7rem;
width: 7rem;
@@ -754,12 +765,15 @@ input[type="checkbox"] {
.popup, .popup.scrollable, .popup.small {
border: none;
width: 90%;
- height: 90%;
+ height: 95%;
max-height: 100%;
}
.bottom-link {
padding-bottom: 2rem;
}
+ .popup-tabs {
+ margin-top: .3rem;
+ }
}
@media screen and (max-width: 400px) {
.popup-title {
diff --git a/src/front/cobalt.js b/src/front/cobalt.js
index b8b5ddfd..7086ec8a 100644
--- a/src/front/cobalt.js
+++ b/src/front/cobalt.js
@@ -1,7 +1,7 @@
let ua = navigator.userAgent.toLowerCase();
let isIOS = ua.match("iphone os");
let isMobile = ua.match("android") || ua.match("iphone os");
-let version = 19;
+let version = 21;
let regex = new RegExp(/https:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/);
let notification = `
`
@@ -13,7 +13,7 @@ let switchers = {
"vQuality": ["hig", "max", "mid", "low"],
"aFormat": ["mp3", "best", "ogg", "wav", "opus"]
}
-let checkboxes = ["disableTikTokWatermark", "fullTikTokAudio"];
+let checkboxes = ["disableTikTokWatermark", "fullTikTokAudio", "muteAudio"];
let exceptions = { // used for mobile devices
"vQuality": "mid"
}
@@ -339,6 +339,7 @@ async function download(url) {
if (sGet("fullTikTokAudio") === "true") req["isTTFullAudio"] = true; // audio tiktok full
} else {
req["vQuality"] = sGet("vQuality").slice(0, 4);
+ if (sGet("muteAudio") === "true") req["isAudioMuted"] = true;
if (url.includes("youtube.com/") || url.includes("/youtu.be/")) req["vFormat"] = sGet("vFormat").slice(0, 4);
if ((url.includes("tiktok.com/") || url.includes("douyin.com/")) && sGet("disableTikTokWatermark") === "true") req["isNoTTWatermark"] = true;
}
diff --git a/src/front/updateBanners/bettertogether.webp b/src/front/updateBanners/bettertogether.webp
new file mode 100644
index 00000000..a1e03806
Binary files /dev/null and b/src/front/updateBanners/bettertogether.webp differ
diff --git a/src/front/updateBanners/shutup.png b/src/front/updateBanners/shutup.png
new file mode 100644
index 00000000..cbc80ae8
Binary files /dev/null and b/src/front/updateBanners/shutup.png differ
diff --git a/src/localization/languages/en.json b/src/localization/languages/en.json
index 745a89e0..57a8a2d1 100644
--- a/src/localization/languages/en.json
+++ b/src/localization/languages/en.json
@@ -1,7 +1,7 @@
{
"name": "english",
"substrings": {
- "ContactLink": "contact the maintainer"
+ "ContactLink": "file an issue on github"
},
"strings": {
"LinkInput": "paste the link here",
@@ -38,7 +38,6 @@
"SettingsAppearanceSubtitle": "appearance",
"SettingsThemeSubtitle": "theme",
"SettingsFormatSubtitle": "download format",
- "SettingsDownloadsSubtitle": "downloads",
"SettingsQualitySubtitle": "quality",
"SettingsThemeAuto": "auto",
"SettingsThemeLight": "light",
@@ -53,11 +52,11 @@
"SettingsEnableDownloadPopup": "ask for a way to save",
"AccessibilityEnableDownloadPopup": "ask what to do with downloads",
"SettingsFormatDescription": "select webm if you want max quality available. webm videos are usually higher bitrate, but ios devices can't play them natively.",
- "SettingsQualityDescription": "if selected quality isn't available, closest one gets picked instead.\nif you want to post a youtube video on social media, then select a combination of mp4 and 720p. those videos are usually not in av1 codec, so they should play just fine basically everywhere.",
+ "SettingsQualityDescription": "if selected quality isn't available, closest one gets picked instead.\nif you want to post a youtube video on social media, select a combination of mp4 and 720p.",
"LinkGitHubIssues": ">> report issues and check out the source code on github",
"LinkGitHubChanges": ">> see previous commits and contribute on github",
"NoScriptMessage": "{appName} uses javascript for api requests and interactive interface. you have to allow javascript to use this site. i don't have any ads or trackers, pinky promise.",
- "DownloadPopupDescriptionIOS": "on ios devices, you have to press and hold the download button, hide the video preview, and then select \"download linked file\" in appeared popup to save the video. this will be required for as long as apple forces safari webview upon all browser developers on ios.",
+ "DownloadPopupDescriptionIOS": "press and hold the download button, hide the video preview, and then select \"download linked file\" to save.",
"DownloadPopupDescription": "download button opens a new tab with requested file. you can disable this popup in settings.",
"DownloadPopupWayToSave": "pick a way to save",
"ClickToCopy": "press to copy",
@@ -73,7 +72,7 @@
"AccessibilityModeToggle": "toggle download mode",
"DonateLinksDescription": "donation links open in a new tab. this is the best way to donate if you want me to receive your donation directly.",
"SettingsAudioFormatBest": "best",
- "SettingsAudioFormatDescription": "when best format is selected, you get audio in best quality available, because audio is kept in its original format. if you select anything other than that, you'll get a slightly compressed file.",
+ "SettingsAudioFormatDescription": "when best format is selected, you get audio in best quality available, because it's not re-encoded. everything else will be re-encoded.",
"Keyphrase": "save what you love",
"SettingsRemoveWatermark": "disable watermark",
"ErrorPopupCloseButton": "got it",
@@ -102,12 +101,15 @@
"MediaPickerExplanationPhoneIOS": "press and hold, hide the preview, and then select \"download linked file\" to save.",
"TwitterSpaceWasntRecorded": "this twitter space wasn't recorded, so there's nothing to download. try another one!",
"ErrorCantProcess": "i couldn't process your request :(\nyou can try again, but if issue persists, please {ContactLink}.",
- "ChangelogPressToHide": "press to hide",
+ "ChangelogPressToHide": "press to collapse",
"Donate": "donate",
"DonateSub": "help me keep it up",
"DonateExplanation": "{appName} does not (and will never) serve ads or sell your data, therefore it's completely free to use. but hey! turns out keeping up a web service used by hundreds of thousands of people is somewhat costly.\n\nif you ever found {appName} useful and want to keep it online, or simply want to thank the developer, consider chipping in! each and every cent helps and is VERY appreciated.",
"DonateVia": "donate via",
"DonateHireMe": "or, as an alternative, you can hire me.",
- "DiscordServer": "join the live conversation about {appName} on the official discord server"
+ "SettingsVideoMute": "mute audio",
+ "SettingsVideoMuteExplanation": "disables audio in downloaded video when possible. ignored when audio mode is on or service only supports audio.",
+ "SettingsVideoGeneral": "general",
+ "ErrorSoundCloudNoClientId": "couldn't find client_id that is required to fetch audio data from soundcloud. try again, and if issue persists, {ContactLink}."
}
}
diff --git a/src/localization/languages/ru.json b/src/localization/languages/ru.json
index f54ef225..b6816d1d 100644
--- a/src/localization/languages/ru.json
+++ b/src/localization/languages/ru.json
@@ -25,7 +25,7 @@
"ErrorUnsupported": "с твоей ссылкой что-то не так, или же этот сервис ещё не поддерживается. может быть, ты вставил не ту ссылку?",
"ErrorBrokenLink": "{s} поддерживается, но с твоей ссылкой что-то не так. может быть, ты её не полностью скопировал?",
"ErrorNoLink": "я не гадалка и не могу угадывать, что ты хочешь скачать. попробуй в следующий раз вставить ссылку.",
- "ErrorPageRenderFail": "что-то пошло не так, поэтому у меня не получилось срендерить страницу. если это повторится ещё раз, пожалуйста, {ContactLink}. также приложи хэш текущего коммита ({s}) с действиями для повторения этой ошибки. можно на русском языке. спасибо :)",
+ "ErrorPageRenderFail": "что-то пошло не так и у меня не получилось срендерить страницу. если это повторится ещё раз, пожалуйста, {ContactLink}. также приложи хэш текущего коммита ({s}) с действиями для повторения этой ошибки. можно на русском языке. спасибо :)",
"ErrorRateLimit": "ты делаешь слишком много запросов. успокойся и попробуй ещё раз через несколько минут.",
"ErrorCouldntFetch": "мне не удалось получить инфу о твоей ссылке. проверь её и попробуй ещё раз.",
"ErrorLengthLimit": "твоё видео длиннее чем {s} минут(ы). это превышает текущий лимит. скачай что-нибудь покороче, а не экранизацию \"войны и мира\".",
@@ -53,8 +53,8 @@
"AccessibilityEnableDownloadPopup": "спрашивать, что делать с загрузками",
"SettingsFormatDescription": "выбирай webm, если хочешь максимальное качество. у webm видео битрейт обычно выше, но устройства на ios не могут проигрывать их без сторонних приложений.",
"SettingsQualityDescription": "если выбранное качество недоступно, то выбирается ближайшее к нему.\nесли ты хочешь опубликовать видео с youtube где-то в соц. сетях, то выбирай комбинацию из mp4 и 720p.",
- "LinkGitHubIssues": ">> сообщай о проблемах и смотри исходный код на гитхабе",
- "LinkGitHubChanges": ">> смотри предыдущие изменения на гитхабе",
+ "LinkGitHubIssues": ">> сообщай о проблемах и смотри исходный код на github",
+ "LinkGitHubChanges": ">> смотри предыдущие изменения на github",
"NoScriptMessage": "{appName} использует javascript для обработки ссылок и интерактивного интерфейса. ты должен разрешить использование javascript, чтобы пользоваться сайтом. тут нет никаких трекеров или рекламы, обещаю.",
"DownloadPopupDescriptionIOS": "зажми кнопку \"скачать\", затем скрой превью видео и выбери \"загрузить файл по ссылке\" в появившемся окне.",
"DownloadPopupDescription": "кнопка скачивания открывает новое окно с файлом. ты можешь отключить выбор метода сохранения файла в настройках.",
diff --git a/src/localization/manager.js b/src/localization/manager.js
index 497c1bcb..2db07745 100644
--- a/src/localization/manager.js
+++ b/src/localization/manager.js
@@ -15,7 +15,7 @@ export function loadLoc() {
}
loadLoc();
export function replaceBase(s) {
- return s.replace(/\n/g, ' ').replace(/{appName}/g, appName).replace(/{repo}/g, repo)// .replace(/{discord}/g, socials.discord)
+ return s.replace(/\n/g, ' ').replace(/{appName}/g, appName).replace(/{repo}/g, repo).replace(/{bS}/g, '
').replace(/{bE}/g, '
').replace(/\*;/g, "•");
}
export function replaceAll(lang, str, string, replacement) {
let s = replaceBase(str[string])
diff --git a/src/modules/changelog/changelog.json b/src/modules/changelog/changelog.json
index 43f86c7a..00c46295 100644
--- a/src/modules/changelog/changelog.json
+++ b/src/modules/changelog/changelog.json
@@ -1,11 +1,21 @@
{
"current": {
+ "version": "4.7",
+ "title": "we're better together! thank you for bug reports.",
+ "banner": "bettertogether.webp",
+ "content": "this update includes a bunch of improvements, many of which were made thanks to the community :D\n\nservice-related improvements:\n*; private soundcloud links are now supported (#68);\n*; tiktok usernames with dots in them no longer confuse cobalt (#71);\n*; .ogg files no longer wrongfully include a video channel (#67);\n*; fixed an issue that caused cobalt to freak out when user attempted to download an audio from audio-only service with \"mute video\" option enabled.\n\nui improvements:\n*; popup padding has been evened out. popups are now able to fit in more information on scroll, especially on mobile;\n*; all buttons are now of even size and are displayed without any padding issues across all modern browsers and devices;\n*; checkbox is no longer crippled on ios;\n*; many explanation texts have been simplified to get rid of unnecessary bloat (no bullshit, remember?);\n*; moved tiktok section in video settings higher due to higher priority.\n\nstability improvements:\n*; ffmpeg process now should end upon finishing the render;\n*; ffmpeg should also quit when download is abruptly cut off;\n*; fixed a memory leak that was caused by misconfigured stream information caching (#63).\n\ninternal improvements:\n*; requested streams are now stored in cache for 2 minutes instead of 1000 hours (yes, 1000 hours, i fucked up);\n*; cached data is now reused if user requests same content within 2 minutes;\n*; page render module is now even cleaner than before;\n*; proper support for bullet-points in loc strings.\n\nyou can suggest features or report bugs on github or twitter. both work just fine, use whichever you're more comfortable with.\n\nthank you for using cobalt, and thank you for reading this changelog.\n\nyou're amazing, keep it up :)"
+ },
+ "history": [{
+ "version": "4.6",
+ "title": "mute videos and proper soundcloud support",
+ "banner": "shutup.png",
+ "content": "i've been longing to implement both of these things, and here they finally are.\n\nservice-related improvements:\n{bS}*; you now can download videos with no audio! simply enable the \"mute audio\" option in settings > audio.\n*; soundcloud module has been updated, and downloads should no longer break after some time.{bE}\nvisual improvements:\n{bS}*; moved some things around in settings popup, and added separators where separation is needed.\n*; updated some texts in english and russian.\n*; version and commit hash have been joined together, now they're a single unit.{bE}\ninternal improvements:\n{bS}*; updated api documentation to include isAudioMuted.\n*; simplified the startup message.\n*; created render elements for separator and explanation due to high duplication of them in the page.\n*; fully deprecated GET method for API requests.\n*; fixed some code quirks.{bE}\nhere's how soundcloud downloads got fixed:\n\npreviously, client_id was (stupidly) hardcoded. that means cobalt wasn't able to fetch song data if soundcloud web app got updated.\nnow, cobalt tries to find the up-to-date client_id, caches it in memory, and checks if web app version has changed to update the id accordingly. you can see this change for yourself on github."
+ }, {
"version": "4.5",
"title": "better, faster, stronger, stable",
"banner": "meowthstrong.webp",
- "content": "your favorite social media downloader just got even better! this update includes a ton of imporvements and fixes.\n\nin fact, there are so many changes, i had to split them in sections.\n\nservice-related improvements:\n
• vimeo module has been revamped, all sorts of videos should now be supported.\n• vimeo audio downloads! you now can download audios from more recent videos.\n• {appName} now supports all sorts of tumblr links. (even those scary ones from the mobile app)\n• vk clips support has been fixed. they rolled back the separation of videos and clips, so i had to do the same.\n• youtube videos with community warnings should now be possible to download.
\nuser interface improvements:\n
• list of supported services is now MUCH easier to read.\n• banners in changelog history should no longer overlap each other.\n• bullet points! they have a bit of extra padding, so it makes them stand out of the rest of text.
\ninternal improvements:\n
• cobalt will now match the link to regex when using ?u= query for autopasting it into input area.\n• better rate limiting: limiting now is done per minute, not per 20 minutes. this ensures less waiting and less attack area for request spammers.\n• moved to my own fork of ytdl-core, cause main project seems to have been abandoned. go check it out on github or npm!\n• ALL user inputs are now properly sanitized on the server. that includes variables for POST api method, too.\n• \"got\" package has been (mostly) replaced by native fetch api. this should greately reduce ram usage.\n• all unnecessary duplications of module imports have been gotten rid of. no more error passing strings from inside of service modules. you don't make mistakes only if you don't do anything, right?\n• other code optimizations. there's less clutter overall.
\nhuge update, right? seems like everything's fixed now?\n\nnope, one issue still persists: sometimes youtube server drops packets for an audio file while cobalt's rendering the video for you. this results in abrupt cuts of audio. if you want to help solving this issue, please feel free to do it on github!\n\nthank you for reading this, and thank you for sticking with cobalt and me."
- },
- "history": [{
+ "content": "your favorite social media downloader just got even better! this update includes a ton of imporvements and fixes.\n\nin fact, there are so many changes, i had to split them in sections.\n\nservice-related improvements:\n{bS}*; vimeo module has been revamped, all sorts of videos should now be supported.\n*; vimeo audio downloads! you now can download audios from more recent videos.\n*; {appName} now supports all sorts of tumblr links. (even those scary ones from the mobile app)\n*; vk clips support has been fixed. they rolled back the separation of videos and clips, so i had to do the same.\n*; youtube videos with community warnings should now be possible to download.{bE}\nuser interface improvements:\n{bS}*; list of supported services is now MUCH easier to read.\n*; banners in changelog history should no longer overlap each other.\n*; bullet points! they have a bit of extra padding, so it makes them stand out of the rest of text.{bE}\ninternal improvements:\n{bS}*; cobalt will now match the link to regex when using ?u= query for autopasting it into input area.\n*; better rate limiting: limiting now is done per minute, not per 20 minutes. this ensures less waiting and less attack area for request spammers.\n*; moved to my own fork of ytdl-core, cause main project seems to have been abandoned. go check it out on github or npm!\n*; ALL user inputs are now properly sanitized on the server. that includes variables for POST api method, too.\n*; \"got\" package has been (mostly) replaced by native fetch api. this should greately reduce ram usage.\n*; all unnecessary duplications of module imports have been gotten rid of. no more error passing strings from inside of service modules. you don't make mistakes only if you don't do anything, right?\n*; other code optimizations. there's less clutter overall.{bE}\nhuge update, right? seems like everything's fixed now?\n\nnope, one issue still persists: sometimes youtube server drops packets for an audio file while cobalt's rendering the video for you. this results in abrupt cuts of audio. if you want to help solving this issue, please feel free to do it on github!\n\nthank you for reading this, and thank you for sticking with cobalt and me."
+ }, {
"version": "4.4",
"title": "over 1 million monthly requests. thank you.",
"banner": "onemillionr.webp",
diff --git a/src/modules/pageRender/elements.js b/src/modules/pageRender/elements.js
index 25bebb92..fd1b6c50 100644
--- a/src/modules/pageRender/elements.js
+++ b/src/modules/pageRender/elements.js
@@ -39,7 +39,15 @@ export function checkbox(action, text, aria, paddingType) {
${text}
`
}
-
+export function sep(paddingType) {
+ let paddingClass = ``
+ switch(paddingType) {
+ case 0:
+ paddingClass += ` top-margin`;
+ break;
+ }
+ return ``
+}
export function popup(obj) {
let classes = obj.classes ? obj.classes : []
let body = obj.body;
@@ -143,7 +151,9 @@ export function footerButtons(obj) {
return `
`
}
-
+export function explanation(text) {
+ return `
${text}
`
+}
export function celebrationsEmoji() {
let n = new Date().toISOString().split('T')[0].split('-');
let dm = `${n[1]}-${n[2]}`;
diff --git a/src/modules/pageRender/page.js b/src/modules/pageRender/page.js
index 2c5c1883..3616cbc9 100644
--- a/src/modules/pageRender/page.js
+++ b/src/modules/pageRender/page.js
@@ -1,4 +1,4 @@
-import { backdropLink, celebrationsEmoji, checkbox, footerButtons, multiPagePopup, popup, popupWithBottomButtons, settingsCategory, switcher } from "./elements.js";
+import { backdropLink, celebrationsEmoji, checkbox, explanation, footerButtons, multiPagePopup, popup, popupWithBottomButtons, sep, settingsCategory, switcher } from "./elements.js";
import { services as s, appName, authorInfo, version, quality, repo, donations, supportedAudio } from "../config.js";
import { getCommitInfo } from "../sub/currentCommit.js";
import loc from "../../localization/manager.js";
@@ -27,11 +27,14 @@ for (let i in donations["crypto"]) {
donate += `