4.1: better tiktok image downloads and celebrations

This commit is contained in:
wukko 2022-10-27 22:27:20 +06:00
parent 37e44f92ea
commit 02529c0b54
16 changed files with 129 additions and 29 deletions

View file

@ -1,7 +1,7 @@
{
"name": "cobalt",
"description": "save what you love",
"version": "4.0.1",
"version": "4.1",
"author": "wukko",
"exports": "./src/cobalt.js",
"type": "module",

View file

@ -29,6 +29,29 @@
"mid": "720",
"low": "480"
},
"celebrations": {
"01-01": "🎄",
"02-17": "😺",
"02-22": "😺",
"03-01": "😺",
"05-26": "🀄",
"08-08": "😺",
"08-26": "🐶",
"10-29": "😺",
"10-30": "🎃",
"10-31": "🎃",
"11-01": "🕯️",
"11-02": "🕯️",
"12-23": "🎄",
"12-24": "🎄",
"12-25": "🎄",
"12-26": "🎄",
"12-27": "🎄",
"12-28": "🎄",
"12-29": "🎄",
"12-30": "🎄",
"12-31": "🎄"
},
"supportedAudio": ["mp3", "ogg", "wav", "opus"],
"ffmpegArgs": {
"webm": ["-c:v", "copy", "-c:a", "copy"],

View file

@ -336,7 +336,7 @@ async function download(url) {
case "picker":
if (j.audio && j.url) {
changeDownloadButton(2, '?..')
fetch(`${j.audio}&p=1&origin=front`).then(async (res) => {
fetch(`${j.audio}&p=1`).then(async (res) => {
let jp = await res.json();
if (jp.status === "continue") {
changeDownloadButton(2, '>>>');
@ -356,7 +356,7 @@ async function download(url) {
break;
case "stream":
changeDownloadButton(2, '?..')
fetch(`${j.url}&p=1&origin=front`).then(async (res) => {
fetch(`${j.url}&p=1`).then(async (res) => {
let jp = await res.json();
if (jp.status === "continue") {
changeDownloadButton(2, '>>>'); window.location.href = j.url;

View file

@ -0,0 +1,7 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.6288 30.0005H11.7156C10.9356 30.0005 10.3036 29.3685 10.3036 28.5884V15.4698C10.3036 14.6897 10.9356 14.0577 11.7156 14.0577H19.6288C20.4089 14.0577 21.0409 14.6897 21.0409 15.4698V28.5884C21.0409 29.3685 20.4089 30.0005 19.6288 30.0005Z" fill="#FFDEA7"/>
<path d="M16.4787 9.73157H14.866V12.1041H16.4787V9.73157Z" fill="#9B9B9B"/>
<path d="M20.5408 11.4495H10.8045C9.80758 11.4495 9 12.2579 9 13.254V17.8972C9 18.6878 9.6336 19.3303 10.4201 19.3449C11.2318 19.3602 11.8961 18.6708 11.8961 17.8592V15.5141C11.8961 15.2624 12.1001 15.0585 12.3517 15.0585C12.6034 15.0585 15.2924 15.0585 15.2924 15.0585C15.4841 15.0585 15.6403 15.2139 15.6403 15.4065V16.1712C15.6403 16.9828 16.3047 17.6722 17.1163 17.6569C17.9036 17.6423 18.5364 16.9998 18.5364 16.2092V15.5141C18.5364 15.2624 18.7404 15.0585 18.992 15.0585C19.2437 15.0585 19.4476 15.2624 19.4476 15.5141V20.1524C19.4476 20.9641 20.112 21.6535 20.9236 21.6381C21.7109 21.6236 22.3437 20.9811 22.3437 20.1905V13.2548C22.3445 12.2579 21.537 11.4495 20.5408 11.4495Z" fill="#FFCE7C"/>
<path d="M18.258 5.57141L16.4082 2.42119C16.078 1.8596 15.2664 1.8596 14.9362 2.42119L13.0807 5.58031C13.0565 5.61996 13.033 5.65962 13.0103 5.70008L12.9998 5.71707C12.7425 6.18479 12.6049 6.72614 12.6268 7.30229C12.6883 8.90694 14.0259 10.2089 15.6313 10.2292C17.3331 10.251 18.7193 8.87862 18.7193 7.18253C18.7193 6.59101 18.5501 6.03832 18.258 5.57141Z" fill="#FFB02E"/>
<path d="M15.6727 9.03566C16.5911 9.03566 17.3356 8.29115 17.3356 7.37275C17.3356 6.45435 16.5911 5.70984 15.6727 5.70984C14.7543 5.70984 14.0098 6.45435 14.0098 7.37275C14.0098 8.29115 14.7543 9.03566 15.6727 9.03566Z" fill="#FCD53F"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

13
src/front/emoji/cat.svg Normal file
View file

@ -0,0 +1,13 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 25.942C4 28.1739 5.76327 30 7.91837 30H24.0816C26.2367 30 28 28.0725 28 25.8406V6.4297C28 5.1297 26.4099 4.5297 25.5155 5.4297L20.9736 10H11.1617L6.5 5.4297C5.6 4.5297 4 5.1297 4 6.4297V25.942Z" fill="#FFB02E"/>
<path d="M9.00005 10.9265L6.20005 13.5265C5.70005 14.0265 4.80005 13.6265 4.80005 12.9265V7.72648C4.80005 7.12648 5.70005 6.72648 6.20005 7.22648L9.00005 9.82648C9.30005 10.1265 9.30005 10.6265 9.00005 10.9265Z" fill="#FF822D"/>
<path d="M23.05 10.9265L25.85 13.5265C26.35 14.0265 27.25 13.6265 27.25 12.9265V7.72648C27.25 7.12648 26.35 6.72648 25.85 7.22648L23.05 9.82648C22.75 10.1265 22.75 10.6265 23.05 10.9265Z" fill="#FF822D"/>
<path d="M17.0429 20H14.9571C14.5117 20 14.2886 20.5386 14.6036 20.8536L15.6465 21.8964C15.8417 22.0917 16.1583 22.0917 16.3536 21.8964L17.3965 20.8536C17.7114 20.5386 17.4884 20 17.0429 20Z" fill="#F70A8D"/>
<path d="M2.72372 20.0528C2.47673 19.9293 2.17639 20.0294 2.0529 20.2764C1.9294 20.5234 2.02951 20.8237 2.2765 20.9472L6.2765 22.9472C6.52349 23.0707 6.82383 22.9706 6.94732 22.7236C7.07082 22.4766 6.97071 22.1763 6.72372 22.0528L2.72372 20.0528Z" fill="#FF6723"/>
<path d="M2.72372 26.9472C2.47673 27.0707 2.17639 26.9706 2.0529 26.7236C1.9294 26.4766 2.02951 26.1763 2.2765 26.0528L6.2765 24.0528C6.52349 23.9293 6.82383 24.0294 6.94732 24.2764C7.07082 24.5234 6.97071 24.8237 6.72372 24.9472L2.72372 26.9472Z" fill="#FF6723"/>
<path d="M29.9473 20.2764C29.8238 20.0294 29.5235 19.9293 29.2765 20.0528L25.2765 22.0528C25.0295 22.1763 24.9294 22.4766 25.0529 22.7236C25.1764 22.9706 25.4767 23.0707 25.7237 22.9472L29.7237 20.9472C29.9707 20.8237 30.0708 20.5234 29.9473 20.2764Z" fill="#FF6723"/>
<path d="M29.2765 26.9472C29.5235 27.0707 29.8238 26.9706 29.9473 26.7236C30.0708 26.4766 29.9707 26.1763 29.7237 26.0528L25.7237 24.0528C25.4767 23.9293 25.1764 24.0294 25.0529 24.2764C24.9294 24.5234 25.0295 24.8237 25.2765 24.9472L29.2765 26.9472Z" fill="#FF6723"/>
<path d="M12 17C11.4477 17 11 17.4477 11 18V19C11 19.5523 11.4477 20 12 20C12.5523 20 13 19.5523 13 19V18C13 17.4477 12.5523 17 12 17Z" fill="#402A32"/>
<path d="M20 17C19.4477 17 19 17.4477 19 18V19C19 19.5523 19.4477 20 20 20C20.5523 20 21 19.5523 21 19V18C21 17.4477 20.5523 17 20 17Z" fill="#402A32"/>
<path d="M15.9999 23.106C15.4625 23.6449 14.5434 24 13.4999 24C12.4681 24 11.5579 23.6527 11.0181 23.1239C11.1384 23.8481 11.9461 27.5 15.9999 27.5C20.0538 27.5 20.8615 23.8481 20.9818 23.1239C20.4419 23.6527 19.5317 24 18.4999 24C17.4564 24 16.5374 23.6449 15.9999 23.106Z" fill="#BB1D80"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.1573 29.9875H12.8456C12.3098 29.9875 11.9026 29.5175 12.0204 29.0275L12.5348 26.8975L15.9094 25.8393L19.4681 26.8975L19.9824 29.0275C20.0896 29.5175 19.6931 29.9875 19.1573 29.9875Z" fill="#6D4534"/>
<path d="M14.86 7.19L12.18 11.9818C11.68 12.8719 12.3 13.9999 13.3 13.9999L13.9079 13.9999C11.7467 13.9999 10 15.5917 10 17.5611C10 18.3615 10.7105 18.9999 11.5789 18.9999H11.7231C9.11588 18.9999 7 21.2268 7 23.9709C7 25.649 8.29359 26.9999 9.87798 26.9999H22.122C23.7164 26.9999 25 25.6385 25 23.9709C25.01 21.2268 22.8941 18.9999 20.2769 18.9999H20.4211C21.2994 18.9999 22 18.3525 22 17.5611C22 15.6007 20.2533 13.9999 18.0921 13.9999L18.65 13.9999C19.65 13.9999 20.27 12.8822 19.77 11.9818L17.09 7.19C16.6 6.29995 15.36 6.29995 14.86 7.19Z" fill="#44911B"/>
<path d="M18.9819 18.3056C19.6943 18.3056 20.2719 17.728 20.2719 17.0156C20.2719 16.3031 19.6943 15.7256 18.9819 15.7256C18.2694 15.7256 17.6919 16.3031 17.6919 17.0156C17.6919 17.728 18.2694 18.3056 18.9819 18.3056Z" fill="#F8312F"/>
<path d="M10.9766 25.3874C11.689 25.3874 12.2666 24.8099 12.2666 24.0974C12.2666 23.385 11.689 22.8074 10.9766 22.8074C10.2641 22.8074 9.68658 23.385 9.68658 24.0974C9.68658 24.8099 10.2641 25.3874 10.9766 25.3874Z" fill="#F8312F"/>
<path d="M23.29 24.0281C23.29 24.7405 22.7124 25.3181 22 25.3181C21.2875 25.3181 20.71 24.7405 20.71 24.0281C20.71 23.3156 21.2875 22.7381 22 22.7381C22.7124 22.7381 23.29 23.3156 23.29 24.0281Z" fill="#F8312F"/>
<path d="M18.2885 12.0161C18.2885 12.7285 17.7109 13.3061 16.9985 13.3061C16.286 13.3061 15.7085 12.7285 15.7085 12.0161C15.7085 11.3036 16.286 10.7261 16.9985 10.7261C17.7109 10.7261 18.2885 11.3036 18.2885 12.0161Z" fill="#FCD53F"/>
<path d="M13.9763 17.2901C14.6887 17.2901 15.2663 16.7125 15.2663 16.0001C15.2663 15.2876 14.6887 14.7101 13.9763 14.7101C13.2638 14.7101 12.6863 15.2876 12.6863 16.0001C12.6863 16.7125 13.2638 17.2901 13.9763 17.2901Z" fill="#FCD53F"/>
<path d="M16 23.2535C16.7125 23.2535 17.29 22.676 17.29 21.9635C17.29 21.2511 16.7125 20.6735 16 20.6735C15.2876 20.6735 14.71 21.2511 14.71 21.9635C14.71 22.676 15.2876 23.2535 16 23.2535Z" fill="#FCD53F"/>
<path d="M17.0045 3.08977L17.7004 3.19609C18.0581 3.24442 18.1934 3.67936 17.9421 3.93066L17.4395 4.42359C17.3332 4.52025 17.2945 4.66523 17.3138 4.80054L17.4298 5.49645C17.4878 5.8444 17.1205 6.11503 16.8016 5.95072L16.183 5.6221C16.0573 5.55444 15.9027 5.55444 15.777 5.6221L15.1584 5.95072C14.8395 6.11503 14.4722 5.8444 14.5302 5.49645L14.6462 4.80054C14.6655 4.66523 14.6269 4.52025 14.5205 4.42359L14.0179 3.93066C13.7666 3.67936 13.9019 3.24442 14.2596 3.19609L14.9555 3.09943C15.1005 3.0801 15.2164 2.99312 15.2841 2.86747L15.5934 2.23922C15.748 1.92026 16.212 1.92026 16.3666 2.23922L16.6759 2.86747C16.7436 2.97379 16.8596 3.07044 17.0045 3.08977Z" fill="#F9C23C"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

11
src/front/emoji/dog.svg Normal file
View file

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 9C4 6.79086 5.79086 5 8 5H24C26.2091 5 28 6.79086 28 9V23C28 25.2091 26.2091 27 24 27H8C5.79086 27 4 25.2091 4 23V9Z" fill="#F3C07B"/>
<path d="M24.0625 21.8438C24.0625 17.3688 19.75 15.9688 16.0625 15.9688C11.9375 15.9688 8 17.5312 8 21.8438C8 25.7937 12.3125 29.1875 16.0625 29.1875C20.5625 29.1875 24.0625 24.5312 24.0625 21.8438Z" fill="#FFDEA7"/>
<path d="M12.9922 24.6562L16 22.4062L19.0078 24.6562V27C19.0078 28.6569 17.6569 30 16 30C14.3431 30 12.9922 28.6569 12.9922 27V24.6562Z" fill="#CA0B4A"/>
<path d="M11.7259 6.06679L4.42592 16.3617C3.72124 17.3555 2.15625 16.8569 2.15625 15.6387V8.59375C2.15625 6.10847 4.17097 4.09375 6.65625 4.09375H10.7063C11.721 4.09375 12.3129 5.23902 11.7259 6.06679Z" fill="#6D4534"/>
<path d="M20.2428 6.06679L27.5428 16.3617C28.2475 17.3555 29.8125 16.8569 29.8125 15.6387V8.59375C29.8125 6.10847 27.7978 4.09375 25.3125 4.09375H21.2625C20.2477 4.09375 19.6559 5.23902 20.2428 6.06679Z" fill="#6D4534"/>
<path d="M12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13V14C14 14.5523 13.5523 15 13 15C12.4477 15 12 14.5523 12 14V13Z" fill="#212121"/>
<path d="M18 13C18 12.4477 18.4477 12 19 12C19.5523 12 20 12.4477 20 13V14C20 14.5523 19.5523 15 19 15C18.4477 15 18 14.5523 18 14V13Z" fill="#212121"/>
<path d="M17.1446 17H14.8277C14.2439 17 13.7008 17.816 14.19 18.4728C14.5223 18.9188 15.3557 19.8109 16.031 19.8109C16.7064 19.8109 17.4978 18.9188 17.8092 18.4728C18.348 17.6286 17.6236 17.012 17.1446 17Z" fill="#212121"/>
<path d="M16.5 20.5156C16.5 20.2395 16.2761 20.0156 16 20.0156L15.9943 20.0157L15.9886 20.0156C15.7124 20.0156 15.4886 20.2395 15.4886 20.5156C15.4886 20.5981 15.4903 20.6795 15.4937 20.7596C15.3779 22.9801 13.6875 23.9844 12.5312 23.9844C12.2551 23.9844 12.0312 24.2082 12.0312 24.4844C12.0312 24.7605 12.2551 24.9844 12.5312 24.9844C13.7421 24.9844 15.2302 24.2385 15.9943 22.7417C16.7584 24.2385 18.2465 24.9844 19.4573 24.9844C19.7335 24.9844 19.9573 24.7605 19.9573 24.4844C19.9573 24.2082 19.7335 23.9844 19.4573 23.9844C18.3011 23.9844 16.6107 22.9801 16.4949 20.7596C16.4983 20.6795 16.5 20.5981 16.5 20.5156Z" fill="#212121"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,7 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.7434 8H17.2495C17.6569 8 18 7.72792 18 7.38563V4.61217C18 4.07678 17.2066 3.79593 16.7348 4.17333L13.2288 6.95556C12.7463 7.33297 13.0787 8 13.7434 8Z" fill="#86D72F"/>
<path d="M21.4384 29H10.5674C4.85109 29 0.739367 23.4263 2.35397 17.8627L3.69781 13.2349C4.77087 9.54276 8.11039 7 11.9112 7H20.1447C23.9756 7 27.3453 9.58345 28.3882 13.3366L29.6719 17.9644C31.2163 23.5076 27.1146 29 21.4384 29Z" fill="#FF8257"/>
<path d="M9.41288 15H11.585C11.9381 15 12.13 14.5663 11.8997 14.2852L10.7868 13.1527C10.6179 12.9438 10.3186 12.9519 10.1497 13.1607L9.09052 14.2932C8.87561 14.5743 9.06749 15 9.41288 15Z" fill="#321B41"/>
<path d="M20.4129 15H22.585C22.9381 15 23.13 14.5663 22.8997 14.2852L21.7868 13.1527C21.6179 12.9438 21.3186 12.9519 21.1497 13.1607L20.0905 14.2932C19.8756 14.5743 20.0675 15 20.4129 15Z" fill="#321B41"/>
<path d="M21.3829 17H24C24 20.3657 21.4523 23.1944 18.0025 24C17.6059 23.4898 16.8823 22.7737 15.9603 22.7737C14.8699 22.7737 14.2057 23.4629 13.8686 23.9642C10.4882 23.1228 8 20.321 8 17H10.6072C11.0235 17.5013 11.7175 18.1458 12.5898 18.1458C13.6506 18.1458 14.3048 17.5013 14.6518 17H17.3383C17.7546 17.5013 18.4486 18.1458 19.3209 18.1458C20.3817 18.1458 21.0359 17.5013 21.3829 17Z" fill="#321B41"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,13 +1,17 @@
{
"current": {
"version": "4.0",
"title": "better and faster than ever",
"content": "this update has a ton of improvements and new features.\n\nchanges you probably care about:\n- cobalt now has support for recorded twitter spaces! download the previous conversation no matter how long it was.\n- download speeds from youtube are at least 10 times better now. you're welcome.\n- both video and audio length limits have been extended to 2 hours.\n- audio downloads from youtube, youtube music, twitter spaces, and soundcloud now have metadata! most often it's just title and artist, but when cobalt is able to get more info, it adds that metadata too.\n- tiktok downloads have been fixed, yet again, and if they ever break in the future, cobalt will fall back to downloading a less annoyingly watermarked video.\n- soundcloud downloads have been fixed, too.\n\nless notable changes:\n- currently experimenting with using mp3 as default audio format. if you set something other than mp3 before, it'll be set to mp3. you can always change it back in settings. let me know what you think about this.\n- \"download audio\" button from image picker no longer stays on the screen after popup was closed.\n- clipboard button now shows up depending on your browser's support for it.\n- you can no longer manually hide the clipboard button, 'cause it's unnecessary.\n- small internal improvements such as separation of changelog version and title.\n- fair bit of internal clean up.\n\nif you want to help me implement covers for downloaded audios, <a class=\"text-backdrop\" href=\"https://github.com/wukko/cobalt\" target=\"_blank\">you can do it on github</a>.\n\nfun fact: average cobalt user is 10 times cooler than everyone else."
"version": "4.1",
"title": "better tiktok image downloads",
"content": "here's what's up:\n- tiktok images are saved as .jpeg instead of .webp (finally, i know).\n- added support for image downloads from douyin.\n- fixed tiktok audio downloads from the image picker.\n- emoji in about button now changes on special occasions. be it halloween or christmas, {appName} will change just a tiny bit to fit in :D\n\nif you're not caught up with new stuff in {appName} 4.x yet, check out the previous changelog down below. there's a ton of stuff to like."
},
"history": [{
"version": "4.0",
"title": "better and faster than ever",
"content": "this update has a ton of improvements and new features.\n\nchanges you probably care about:\n- {appName} now has support for recorded twitter spaces! download the previous conversation no matter how long it was.\n- download speeds from youtube are at least 10 times better now. you're welcome.\n- both video and audio length limits have been extended to 2 hours.\n- audio downloads from youtube, youtube music, twitter spaces, and soundcloud now have metadata! most often it's just title and artist, but when {appName} is able to get more info, it adds that metadata too.\n- tiktok downloads have been fixed, yet again, and if they ever break in the future, {appName} will fall back to downloading a less annoyingly watermarked video.\n- soundcloud downloads have been fixed, too.\n\nless notable changes:\n- currently experimenting with using mp3 as default audio format. if you set something other than mp3 before, it'll be set to mp3. you can always change it back in settings. let me know what you think about this.\n- \"download audio\" button from image picker no longer stays on the screen after popup was closed.\n- clipboard button now shows up depending on your browser's support for it.\n- you can no longer manually hide the clipboard button, 'cause it's unnecessary.\n- small internal improvements such as separation of changelog version and title.\n- fair bit of internal clean up.\n\nif you want to help me implement covers for downloaded audios, <a class=\"text-backdrop\" href=\"https://github.com/wukko/cobalt\" target=\"_blank\">you can do it on github</a>.\n\nfun fact: average {appName} user is 10 times cooler than a regular person."
}, {
"version": "3.7",
"title": "support for multi media tweets is here!",
"content": "{appName} now lets you save any of the videos or gifs in a tweet. even if there are many of them.\n\nsimply paste a link like you'd usually do and {appName} will ask what exactly you want to save.\n\nFIREFOX USERS: if you have strict tracking protection on, you might wanna turn it off for {appName}, or else twitter video previews won't load. firefox filters out twitter image cdn as if it was a tracker, which it's not. it's a false-positive.\n\nhowever, you can leave it on if you're fine with blank squares and video numbers. i have thought of that in prior, you're welcome.\n\nother changes:\n- repurposed ex tiktok-only image picker to be dynamic and adapt depending on content to pick. that's exactly how twitter multi media downloads work.\n- cobalt is now properly viewable on phones with tiny screens, such as first gen iphone se.\n- scrollbars now should be visible only where they're needed.\n- brought back proper twitter api, because other one doesn't have multi media stuff (at least yet).\n- cleaned up some internal files, including main frontend js file.\n- reorganized some files in project directory, now you won't get lost when contributing or just looking through cobalt's code."
"content": "{appName} now lets you save any of the videos or gifs in a tweet. even if there are many of them.\n\nsimply paste a link like you'd usually do and {appName} will ask what exactly you want to save.\n\nFIREFOX USERS: if you have strict tracking protection on, you might wanna turn it off for {appName}, or else twitter video previews won't load. firefox filters out twitter image cdn as if it was a tracker, which it's not. it's a false-positive.\n\nhowever, you can leave it on if you're fine with blank squares and video numbers. i have thought of that in prior, you're welcome.\n\nother changes:\n- repurposed ex tiktok-only image picker to be dynamic and adapt depending on content to pick. that's exactly how twitter multi media downloads work.\n- {appName} is now properly viewable on phones with tiny screens, such as first gen iphone se.\n- scrollbars now should be visible only where they're needed.\n- brought back proper twitter api, because other one doesn't have multi media stuff (at least yet).\n- cleaned up some internal files, including main frontend js file.\n- reorganized some files in project directory, now you won't get lost when contributing or just looking through {appName}'s code."
}, {
"version": "3.6.2 + 3.6.3",
"title": "less disturbance",
@ -15,7 +19,7 @@
}, {
"version": "3.6",
"title": "improvements all around!",
"content": "- download mode switcher is moving places, it's now right next to link input area.\n- smart mode has been renamed to auto mode, because this name is easier to understand.\n- all spacings in ui have been evened out. no more eye strain.\n- added support for twitter /video/1 links\n- clipboard button exception has been redone to prepare for adoption of readtext clipboard api in firefox.\n- cobalt is now using different tiktok api endpoint, because previous one got killed, just like the one before.\n- \"other\" settings tab has been cleaned up."
"content": "- download mode switcher is moving places, it's now right next to link input area.\n- smart mode has been renamed to auto mode, because this name is easier to understand.\n- all spacings in ui have been evened out. no more eye strain.\n- added support for twitter /video/1 links\n- clipboard button exception has been redone to prepare for adoption of readtext clipboard api in firefox.\n- {appName} is now using different tiktok api endpoint, because previous one got killed, just like the one before.\n- \"other\" settings tab has been cleaned up."
}, {
"version": "3.5.4",
"title": "tiktok support is back :D",
@ -23,7 +27,7 @@
}, {
"version": "3.5.2",
"title": "vk clips support, improved changelog system, and less bugs",
"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."
"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, {appName} 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- {appName} 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."
}, {
"version": "3.5",
"title": "ui revamp and usability imporvements",

View file

@ -19,4 +19,5 @@ export const
internetExplorerRedirect = config.internetExplorerRedirect,
donations = config.donations,
ffmpegArgs = config.ffmpegArgs,
supportedAudio = config.supportedAudio
supportedAudio = config.supportedAudio,
celebrations = config.celebrations

View file

@ -8,10 +8,16 @@ const names = {
"🪅": "pinata",
"🪄": "magic_wand",
"🐲": "dragon_face",
"🀄": "dragon_face_wukko",
"💸": "money_with_wings",
"⚙️": "gear",
"☹️": "frowning_face",
"📋": "clipboard"
"📋": "clipboard",
"🎃": "pumpkin",
"🎄": "christmas_tree",
"🕯️": "candle",
"😺": "cat",
"🐶": "dog"
}
let sizing = {
22: 0.4,

View file

@ -1,3 +1,5 @@
import { celebrations } from "../config.js";
export function switcher(obj) {
let items = ``;
switch(obj.name) {
@ -135,3 +137,9 @@ export function footerButtons(obj) {
return `
<div id="footer-buttons">${items}</div>`
}
export function celebrationsEmoji() {
let n = new Date().toISOString().split('T')[0].split('-');
let dm = `${n[1]}-${n[2]}`;
return Object.keys(celebrations).includes(dm) ? celebrations[dm] : "🐲";
}

View file

@ -1,11 +1,10 @@
import { backdropLink, checkbox, footerButtons, multiPagePopup, popup, popupWithBottomButtons, settingsCategory, switcher } from "./elements.js";
import { services, appName, authorInfo, version, quality, repo, donations, supportedAudio } from "../config.js";
import { backdropLink, celebrationsEmoji, checkbox, footerButtons, multiPagePopup, popup, popupWithBottomButtons, 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";
import emoji from "../emoji.js";
import changelogManager from "../changelog/changelogManager.js";
let s = services;
let com = getCommitInfo();
let enabledServices = Object.keys(s).filter((p) => {
@ -311,7 +310,7 @@ export default function(obj) {
footerButtons([{
name: "about",
type: "popup",
text: `${emoji("🐲", 22)} ${loc(obj.lang, 'AboutTab')}`,
text: `${emoji(celebrationsEmoji() , 22)} ${loc(obj.lang, 'AboutTab')}`,
aria: loc(obj.lang, 'AccessibilityOpenAbout')
}, {
name: "settings",

View file

@ -48,10 +48,16 @@ export default function(r, host, ip, audioFormat, isAudioOnly) {
switch (host) {
case "douyin":
case "tiktok":
let type = "render";
if (audioFormat === "mp3" || audioFormat === "best") {
audioFormat = "mp3"
type = "bridge"
}
return apiJSON(5, {
type: type,
picker: r.picker,
u: Array.isArray(r.urls) ? r.urls[1] : r.urls, service: host, ip: ip,
filename: r.audioFilename, salt: process.env.streamSalt, isAudioOnly: true, audioFormat: audioFormat, copy: audioFormat === "best" ? true : false
filename: r.audioFilename, salt: process.env.streamSalt, isAudioOnly: true, audioFormat: audioFormat, copy: audioFormat === "best" ? true : false,
})
case "twitter":
return apiJSON(5, {
@ -64,7 +70,7 @@ export default function(r, host, ip, audioFormat, isAudioOnly) {
let copy = false;
if (!supportedAudio.includes(audioFormat)) audioFormat = "best";
if ((host === "tiktok" || host === "douyin") && isAudioOnly && services.tiktok.audioFormats.includes(audioFormat)) {
if ((host == "tiktok" || host == "douyin") && isAudioOnly && services.tiktok.audioFormats.includes(audioFormat)) {
if (r.isMp3) {
if (audioFormat === "mp3" || audioFormat === "best") {
audioFormat = "mp3"

View file

@ -15,17 +15,16 @@ let config = {
}
}
function selector(j, h, id) {
let t;
switch (h) {
case "tiktok":
let t = j["aweme_list"].filter((v) => {
if (v["aweme_id"] == id) return true
})
if (t.length > 0) {
return t[0]
} else return false
t = j["aweme_list"].filter((v) => { if (v["aweme_id"] == id) return true })
break;
case "douyin":
return j['item_list'][0]
t = j['item_list'].filter((v) => { if (v["aweme_id"] == id) return true })
break;
}
if (t.length > 0) { return t[0] } else return false
}
export default async function(obj) {
@ -53,10 +52,13 @@ export default async function(obj) {
} else throw new Error()
} else throw new Error()
}
let video, videoFilename, audioFilename, isMp3, audio,
images = detail["image_post_info"] ? detail["image_post_info"]["images"] : false,
let video, videoFilename, audioFilename, isMp3, audio, images,
filenameBase = `${obj.host}_${obj.postId}`;
if (obj.host == "tiktok") {
images = detail["image_post_info"] ? detail["image_post_info"]["images"] : false
} else {
images = detail["images"] ? detail["images"] : false
}
if (!obj.isAudioOnly && !images) {
video = obj.host === "tiktok" ? detail["video"]["play_addr"]["url_list"][0] : detail["video"]["play_addr"]["url_list"][0].replace("playwm", "play");
videoFilename = `${filenameBase}_video_nw.mp4` // nw - no watermark
@ -98,7 +100,9 @@ export default async function(obj) {
if (images) {
let imageLinks = [];
for (let i in images) {
imageLinks.push({url: images[i]["display_image"]["url_list"][0]})
let selector = obj.host == "tiktok" ? images[i]["display_image"]["url_list"] : images[i]["url_list"];
selector = selector.filter((i) => { if (i.includes(".jpeg?")) return true; })
imageLinks.push({url: selector[0]})
}
return {
picker: imageLinks,

View file

@ -23,7 +23,7 @@ export function createStream(obj) {
audioFormat: obj.audioFormat,
time: obj.time,
copy: obj.copy,
metadata: obj.fileMetadata
metadata: obj.fileMetadata ? obj.fileMetadata : false
});
return `${process.env.selfURL}api/stream?t=${streamUUID}&e=${exp}&h=${ghmac}`;
}