[PR #1033] [CLOSED] Fix yt cookies and api error idea (or example) #1301

Closed
opened 2025-11-09 10:10:10 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/imputnet/cobalt/pull/1033
Author: @vsecoder
Created: 1/3/2025
Status: Closed

Base: mainHead: main


📝 Commits (10+)

📊 Changes

11 files changed (+813 additions, -668 deletions)

View changed files

📝 api/package.json (+2 -1)
📝 api/src/processing/match-action.js (+1 -0)
📝 api/src/processing/match.js (+2 -1)
📝 api/src/processing/request.js (+2 -1)
📝 api/src/processing/services/twitter.js (+30 -61)
📝 api/src/processing/services/youtube.js (+46 -461)
📝 docs/api.md (+60 -143)
src/modules/processing/matchActionDecider.js (+200 -0)
src/modules/processing/request.js (+164 -0)
src/modules/processing/services/vk.js (+61 -0)
src/modules/processing/services/youtube.js (+245 -0)

📄 Description

I tried to rewrite from youtubei to ytdl, which helped get rid of the need for cookies, but created a few other problems.:

  1. you need to look for a video format with audio among the options
  2. for some reason, during the tests, the video was received in poor quality. (360+p return m3u8 files)
    But with all this, the output is a beautiful link with a redirect to the file, and there are no problems with cookies.

Example answer:

{
	"status": "redirect",
	"url": {
		"360p": {
			"url": "https://rr3---sn-5hne6nzy.googlevideo.com/videoplayback?expire=1735961581&ei=jVd4Z92fOMPf6dsPj_SL4Qo&ip=2a13%3A4ac0%3A10%3A0%3Af816%3A3eff%3Afe6e%3A838c&id=o-AM7KPAJZSwM-pvf-6Tfwci9ooYi30NNFGPeRQ-IouT0O&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1735939981%2C&mh=7c&mm=31%2C29&mn=sn-5hne6nzy%2Csn-5hnekn7s&ms=au%2Crdu&mv=m&mvi=3&pl=64&rms=au%2Cau&initcwndbps=1323750&bui=AfMhrI_KqxSyqcP0QJeI2JciVpkjy_CWlveLBCTKNq1F6r_y96_2-ed--TKQw0kqSn5XFgQ5uEMwBCMd&vprv=1&svpuc=1&mime=video%2Fmp4&ns=qJSUrvFAe6N-x-Py5R0nwugQ&rqh=1&cnr=14&ratebypass=yes&dur=212.091&lmt=1717051812678016&mt=1735939493&fvip=2&fexp=51326932%2C51331020%2C51335594%2C51371294&c=MWEB&sefc=1&txp=4538434&n=OAmreqw0s4M-YQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Ccnr%2Cratebypass%2Cdur%2Clmt&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAIxP45zKfK0pI3ysO930nnItu8PqHj0HVCi9kkL992JxAiEAr1JayjMjjaitug7HBwHGrFdcpy60aAEOgvo33zwQmmc%3D&sig=AJfQdSswRQIhAOvsVu4tDkiP5rM-EORQQ3mmce9qkNLJFOrw6_7MUZWLAiBDkJrhUxgUVL6wX6YVjbdV464eDfTR8PxLN-fxP_U3jQ%3D%3D",
			"extension": "mp4",
			"resolution": "360p",
			"youtubeFormat": "mp4"
		}
	},
	"filename": "_.undefined" // error due to ignorance of project architecture
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/imputnet/cobalt/pull/1033 **Author:** [@vsecoder](https://github.com/vsecoder) **Created:** 1/3/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`4284661`](https://github.com/imputnet/cobalt/commit/4284661afef8725d54bab9cf93ef2eedf2a20486) Also provide mediaMetadata - [`7c7c60c`](https://github.com/imputnet/cobalt/commit/7c7c60cccc7fad93d7f423a018135b9786bb3eb3) Get rid of variable - [`92db295`](https://github.com/imputnet/cobalt/commit/92db295619aa59eaa2ec4dfd777ef1b77234d0ee) Added title to mediaMetadata, improved twitter mediaMetadata building - [`096066b`](https://github.com/imputnet/cobalt/commit/096066bc36a49d59e6c6a07ce13a9c1cc4324622) Fix docs - [`12e1fa6`](https://github.com/imputnet/cobalt/commit/12e1fa64972bf77e446eccdfb7f601e1d7a94ec6) Fix docs spacing - [`ef6bf10`](https://github.com/imputnet/cobalt/commit/ef6bf10e9234222e0eea2d9ae0a57a50e4bfbddd) Remove console.log - [`29ee3a6`](https://github.com/imputnet/cobalt/commit/29ee3a6e7e77b2a43bf1e2198af5f8212ac7fe04) Added support of VK for mediaMetadata - [`f03188f`](https://github.com/imputnet/cobalt/commit/f03188fea40fe53d099bfb62b7122be602f213da) Merge commit 'refs/pull/613/head' of https://github.com/imputnet/cobalt - [`4a53a4a`](https://github.com/imputnet/cobalt/commit/4a53a4a51e4e1fc063ee2a6db8ddfaed6833afb4) Revert "Merge commit 'refs/pull/613/head' of https://github.com/imputnet/cobalt" - [`ecf8896`](https://github.com/imputnet/cobalt/commit/ecf88966977c6a7c29fe671af7ef46b7e94a9cae) Reapply "Merge commit 'refs/pull/613/head' of https://github.com/imputnet/cobalt" ### 📊 Changes **11 files changed** (+813 additions, -668 deletions) <details> <summary>View changed files</summary> 📝 `api/package.json` (+2 -1) 📝 `api/src/processing/match-action.js` (+1 -0) 📝 `api/src/processing/match.js` (+2 -1) 📝 `api/src/processing/request.js` (+2 -1) 📝 `api/src/processing/services/twitter.js` (+30 -61) 📝 `api/src/processing/services/youtube.js` (+46 -461) 📝 `docs/api.md` (+60 -143) ➕ `src/modules/processing/matchActionDecider.js` (+200 -0) ➕ `src/modules/processing/request.js` (+164 -0) ➕ `src/modules/processing/services/vk.js` (+61 -0) ➕ `src/modules/processing/services/youtube.js` (+245 -0) </details> ### 📄 Description I tried to rewrite from youtubei to ytdl, which helped get rid of the need for cookies, but created a few other problems.: 1. you need to look for a video format with audio among the options 2. for some reason, during the tests, the video was received in poor quality. (360+p return m3u8 files) But with all this, the output is a beautiful link with a redirect to the file, and there are no problems with cookies. Example answer: ```json { "status": "redirect", "url": { "360p": { "url": "https://rr3---sn-5hne6nzy.googlevideo.com/videoplayback?expire=1735961581&ei=jVd4Z92fOMPf6dsPj_SL4Qo&ip=2a13%3A4ac0%3A10%3A0%3Af816%3A3eff%3Afe6e%3A838c&id=o-AM7KPAJZSwM-pvf-6Tfwci9ooYi30NNFGPeRQ-IouT0O&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1735939981%2C&mh=7c&mm=31%2C29&mn=sn-5hne6nzy%2Csn-5hnekn7s&ms=au%2Crdu&mv=m&mvi=3&pl=64&rms=au%2Cau&initcwndbps=1323750&bui=AfMhrI_KqxSyqcP0QJeI2JciVpkjy_CWlveLBCTKNq1F6r_y96_2-ed--TKQw0kqSn5XFgQ5uEMwBCMd&vprv=1&svpuc=1&mime=video%2Fmp4&ns=qJSUrvFAe6N-x-Py5R0nwugQ&rqh=1&cnr=14&ratebypass=yes&dur=212.091&lmt=1717051812678016&mt=1735939493&fvip=2&fexp=51326932%2C51331020%2C51335594%2C51371294&c=MWEB&sefc=1&txp=4538434&n=OAmreqw0s4M-YQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Ccnr%2Cratebypass%2Cdur%2Clmt&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAIxP45zKfK0pI3ysO930nnItu8PqHj0HVCi9kkL992JxAiEAr1JayjMjjaitug7HBwHGrFdcpy60aAEOgvo33zwQmmc%3D&sig=AJfQdSswRQIhAOvsVu4tDkiP5rM-EORQQ3mmce9qkNLJFOrw6_7MUZWLAiBDkJrhUxgUVL6wX6YVjbdV464eDfTR8PxLN-fxP_U3jQ%3D%3D", "extension": "mp4", "resolution": "360p", "youtubeFormat": "mp4" } }, "filename": "_.undefined" // error due to ignorance of project architecture } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-09 10:10:10 -06:00
Sign in to join this conversation.