mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
disabled tiktok and made it impossible to run the server unless all requirements are met
This commit is contained in:
parent
33d8408ad2
commit
ad0846ac73
|
@ -21,7 +21,7 @@ const app = express();
|
|||
|
||||
app.disable('x-powered-by');
|
||||
|
||||
if (fs.existsSync('./.env')) {
|
||||
if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt && process.env.port) {
|
||||
const apiLimiter = rateLimit({
|
||||
windowMs: 20 * 60 * 1000,
|
||||
max: 100,
|
||||
|
@ -124,7 +124,6 @@ if (fs.existsSync('./.env')) {
|
|||
res.redirect('/api/json')
|
||||
});
|
||||
app.get("/", (req, res) => {
|
||||
// redirect masochists to a page where they can install a proper browser
|
||||
if (req.header("user-agent") && req.header("user-agent").includes("Trident")) {
|
||||
if (internetExplorerRedirect.newNT.includes(req.header("user-agent").split('NT ')[1].split(';')[0])) {
|
||||
res.redirect(internetExplorerRedirect.new)
|
||||
|
@ -152,5 +151,5 @@ if (fs.existsSync('./.env')) {
|
|||
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`)
|
||||
});
|
||||
} else {
|
||||
console.log('Required config files are missing. Please run "npm run setup" first.')
|
||||
console.log(`you can't run the server without generating a .env file. please run the setup script first: npm run setup`)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let isIOS = navigator.userAgent.toLowerCase().match("iphone os");
|
||||
let isFirefox = navigator.userAgent.toLowerCase().match("firefox/");
|
||||
let version = 8;
|
||||
let version = 9;
|
||||
let regex = new RegExp(/https:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/);
|
||||
|
||||
let switchers = {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
{
|
||||
"current": {
|
||||
"title": "vk clips support, improved changelog system, and less bugs (3.5.2)",
|
||||
"content": "new features: \n- added support for vk clips. {appName} now lets you download even more cringy videos!\n- added update history right to the changelog menu. it's not loaded by default to minimize page load time, but can be loaded upon pressing a button. probably someone will enjoy this.\n- as you've just read, cobalt now has on-demand blocks. they're rendered on server upon request and exist to prevent any unnecessary clutter by default. the first feature to use on-demand rendering is history of updates in changelog tab.\n\nchanges:\n- moved twitter entry to about tab and made it localized.\n- added clarity to what services exactly are supported in about tab.\n\nbug fixes:\n- cobalt should no longer crash to firefox users if they love to play around with user-agent switching.\n- vk videos of any resolution and aspect ratio should now be downloadable.\n- vk quality picking has been fixed after vk broke it for parsers on their side."
|
||||
"title": "here's what's up with tiktok support",
|
||||
"content": "recently tiktok pushed a breaking change to their api, and long story short: cobalt can't get tiktok video info anymore (for now).\ni had to disable support for tiktok until i figure out how to solve this issue. sorry for any caused inconvenience.\nactually, blame tiktok for this. they try to gatekeep access to content they don't own.\nby doing this, they force people to watch ads and give away personal information on their platform, along with making it impossible to archive content in any viable form.\n\nif you want to help me figure out the fix faster, you can do it on <a class=\"text-backdrop\" href=\"{repo}/blob/current/src/modules/services/tiktok.js\" target=\"_blank\">github</a>.\n\nbig tech companies really don't like it when people have freedom, huh?"
|
||||
},
|
||||
"history": [{
|
||||
"title": "vk clips support, improved changelog system, and less bugs (3.5.2)",
|
||||
"content": "new features: \n- added support for vk clips. {appName} now lets you download even more cringy videos!\n- added update history right to the changelog menu. it's not loaded by default to minimize page load time, but can be loaded upon pressing a button. probably someone will enjoy this.\n- as you've just read, cobalt now has on-demand blocks. they're rendered on server upon request and exist to prevent any unnecessary clutter by default. the first feature to use on-demand rendering is history of updates in changelog tab.\n\nchanges:\n- moved twitter entry to about tab and made it localized.\n- added clarity to what services exactly are supported in about tab.\n\nbug fixes:\n- cobalt should no longer crash to firefox users if they love to play around with user-agent switching.\n- vk videos of any resolution and aspect ratio should now be downloadable.\n- vk quality picking has been fixed after vk broke it for parsers on their side."
|
||||
}, {
|
||||
"title": "ui revamp and usability imporvements (3.5)",
|
||||
"content": "new features:\n- {appName} now lets you paste the link in your clipboard and download the file in a single press of a button.if your clipboard's latest content isn't a valid url, {appName} won't process or paste it. you can also hide the clipboard button in settings if you want to.\nunfortunately, the clipboard feature is not available to firefox users because mozilla didn't add proper support for clipboard api.\n- there's now a button to quickly clean the input area, right next to download button. it's really useful in case when you want to quickly save a bunch of videos and don't want to bother selecting text.\n- keyboard shortcuts! you love them, i love them, and now we can use them to perform quick actions in {appName}. use ctrl+v combo to paste the link without focusing the input area; press escape key to close the active popup or clean the input area; and if you didn't know, you can also press enter to download content from the link.\n\nnew looks:\n- main box has been revamped. it has lost its border, thick padding, and now feels light and fresh.\n- download button is now prettier, and has been tuned to make >> look just like the logo.\n- buttons on the bottom now actually look like buttons and are way more descriptive. no more #@+?$ bullshit. it's way easier to see and understand what each of them does.\n- bottom buttons are prettier and easier to use on a phone. they're bigger and stretch out to sides, making them easier to press.\n\nfixes:\n- it's now impossible to overlap multiple popups at once. no more mess if you decide to explore popups while waiting for request to process.\n- popup tabs have been slightly moved down to prevent popup content overlapping.\n- ui scalability has been improved."
|
||||
}]
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
"tiktok": {
|
||||
"patterns": [":user/video/:postId", ":id", "t/:id"],
|
||||
"audioFormats": ["best", "m4a", "mp3"],
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
"douyin": {
|
||||
"patterns": ["video/:postId", ":id"],
|
||||
|
|
Loading…
Reference in a new issue