[PR #124] [CLOSED] Fix local development issue + Add title of YouTube video #1020

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

📋 Pull Request Information

Original PR: https://github.com/imputnet/cobalt/pull/124
Author: @fluofoxxo
Created: 5/8/2023
Status: Closed

Base: currentHead: current


📝 Commits (4)

📊 Changes

5 files changed (+138 additions, -9 deletions)

View changed files

📝 src/front/cobalt.js (+2 -1)
📝 src/modules/processing/match.js (+5 -1)
📝 src/modules/processing/services/youtube.js (+66 -3)
📝 src/modules/stream/manage.js (+3 -3)
📝 src/modules/sub/utils.js (+62 -1)

📄 Description

This PR fixes an issue when deploying cobalt under the standard settings on localhost, where POSTing /api/json would yield a response that contained a URL formatted as https://localhost/stream as opposed to the valid http://localhost:9000/stream. This has been solved by only sending the slug of the URL, and using the frontend to get the current site's origin and prepend it to the slug for an API call. This resolves issues related to http:// vs. https:// usage, as well as assures that the server's port is included in the request URL, both of which are essential to getting a local development instance working.

Adding the title of the video contributes towards solving #108, starting with YouTube video title. The title of the video is inserted in the downloaded filename after youtube at the start of the filename and before the video's ID.

For ease of type hinting in supported IDEs, typing has been added to some objects related to video information. These typings should go into a better spot, although no precedent exists for where typed objects should go, if they should be present.


🔄 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/124 **Author:** [@fluofoxxo](https://github.com/fluofoxxo) **Created:** 5/8/2023 **Status:** ❌ Closed **Base:** `current` ← **Head:** `current` --- ### 📝 Commits (4) - [`b626270`](https://github.com/imputnet/cobalt/commit/b62627058e5935b97113778b3786999074bd8b48) Fix local development download issues - [`e8a48c5`](https://github.com/imputnet/cobalt/commit/e8a48c53f2ebd738df179adafa8e8103b7fc5198) Add video title to YouTube download filename - [`c631aeb`](https://github.com/imputnet/cobalt/commit/c631aeb3d5051f0c484d0a2c1effcebb109d0b9d) Merge branch 'current' of https://github.com/wukko/cobalt into current - [`834c03a`](https://github.com/imputnet/cobalt/commit/834c03a39bc71acaa2cd85d4ce517c3c390235a4) Resolve cyclic dependency to fix JS-E1008 in DeepSource ### 📊 Changes **5 files changed** (+138 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/front/cobalt.js` (+2 -1) 📝 `src/modules/processing/match.js` (+5 -1) 📝 `src/modules/processing/services/youtube.js` (+66 -3) 📝 `src/modules/stream/manage.js` (+3 -3) 📝 `src/modules/sub/utils.js` (+62 -1) </details> ### 📄 Description This PR fixes an issue when deploying cobalt under the standard settings on localhost, where POSTing `/api/json` would yield a response that contained a URL formatted as `https://localhost/stream` as opposed to the valid `http://localhost:9000/stream`. This has been solved by only sending the slug of the URL, and using the frontend to get the current site's origin and prepend it to the slug for an API call. This resolves issues related to `http://` vs. `https://` usage, as well as assures that the server's port is included in the request URL, both of which are essential to getting a local development instance working. Adding the title of the video contributes towards solving #108, starting with YouTube video title. The title of the video is inserted in the downloaded filename after `youtube` at the start of the filename and before the video's ID. For ease of type hinting in supported IDEs, typing has been added to some objects related to video information. These typings should go into a better spot, although no precedent exists for where typed objects should go, if they should be present. --- <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:04:12 -06:00
Sign in to join this conversation.