Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to play audio only (no video at all) for playing podcasts etc. #2286

Open
tv21 opened this issue May 18, 2024 · 5 comments
Open
Labels
Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@tv21
Copy link

tv21 commented May 18, 2024

SHORT Table (Summary)
Problem YouTube plays video even when playing something that is essentially audio only, wasting bandwidth.
Solution Have a button to play video only
Alternatives Download the video and play it in an external player (inconvenient)
Scope Hard to say; don't know how many users listen to podcasts or other predominately audio content
Side effects Other than having an additional button I can't think of any
Context The idea would be to prevent playing irrelevant video that wastes bandwidth / battery
@tv21 tv21 added Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels May 18, 2024
@error-404-usernotfound
Copy link

This would be great, putting it in picture and picture giving it a basic audio playbar would be perfect for listening to music while I chat on Discord, ect.

@ImprovedTube
Copy link
Member

hi! & thanks @tv21 @error-404-usernotfound

Our to-do list of buttons: #1445 :

we finished #300 recently


@error-404-usernotfound:

We can't reduce the size of pip but you can set the resolution to 144p, so hiding it might be possible to

Please try our mixer feature in version 3.* http://web.archive.org/web/20220531043659/https://addons.mozilla.org/firefox/downloads/file/3896635/youtube_addon-3.935.xpi, since we can fix it in the current version and add more to it


Let us know if anything else comes to mind sooner or later (Your input can be impactful and i'm not using every feature myself so exact implementations might rely on your voices. Whenever we implement something at all here, we can prepare conceptualize, design with extra depth to make best use of our time and volunteer developer's time and not add anything unnecessary or unsustainable.)

@raszpl
Copy link
Contributor

raszpl commented May 22, 2024

Best we can do without some serious intrusion into YT internals is 'Quality without focus' to 144p and minimizing the tab.

Sadly it appears YT also swaps audio track for lower quality in that case, goes from
251 webm audio only 2 │ 31.29MiB 110k https │ audio only opus 110k 48k [en] medium, webm_dash
to
250 webm audio only 2 │ 16.73MiB 59k https │ audio only opus 59k 48k [en] low, webm_dash
and there is nothing we can do about it

@ImprovedTube
Copy link
Member

serious

opt-in feature @raszpl

https://github.com/Ashish-Bansal/audio-only-youtube/blob/e9815328a39b0f3540e2d495599daf0a150030e4/src/js/background.ts#L75-L81

    const parametersToBeRemoved = ['range', 'rn', 'rbuf', 'ump'];
    const audioURL = this.removeURLParameters(url, parametersToBeRemoved);
    if (audioURL && this.tabIds.get(tabId) !== audioURL) {
      this.tabIds.set(tabId, audioURL);
      this.sendMessage(tabId);

YouTube video url paramters
(these can help us to make some features in demand, such as buffer settings
or to provide fallback methods for other features, to make them more failproof/futureproof)

parameter explanation a Value Value/s
rbuf Buffer size 1000 0, 10000
range Byte range 12345-67890 0-1048576
clen Content length 12345678 98765432
dur Duration 600 3600
quality Video quality hd720 medium, small
rn Random to avoid browser caching 123456
ump Performance metrics 1 0
itag Media format 140 (128kbps AAC) 18 (360p), 22 (720p HD), 137 (1080p), 5 (240p FLV), 17 (144p 3GP), 18 (360p MP4), 22 (720p MP4), 34 (360p FLV), 35 (480p FLV), 36 (240p 3GP), 37 (1080p MP4), 38 (3072p MP4), 43 (360p WebM), 44 (480p WebM), 45 (720p WebM), 46 (1080p WebM), 59 (480p MP4), 78 (480p MP4), 82 (360p MP4), 83 (480p MP4), 84 (720p MP4), 85 (1080p MP4), 91 (144p MP4), 92 (240p MP4), 93 (360p MP4), 94 (480p MP4), 95 (720p MP4), 96 (1080p MP4), 100 (360p WebM), 101 (480p WebM), 102 (720p WebM), 132 (240p MP4), 133 (360p MP4), 134 (480p MP4), 135 (720p MP4), 136 (1080p MP4), 137 (1080p MP4), 138 (2160p MP4), 139 (48kbps M4A), 140 (128kbps M4A), 141 (256kbps M4A)
mime MIME type video/mp4 audio/mp4, video/webm, audio/webm, video/mpeg audio/mpeg, video/ogg audio/ogg audio/wav audio/aac, video/x-flv video/3gpp video/x-matroska
ms Media source au (audio) va (video)
mv Media variant m u
mt Timestamp 1625097600 1625184000
lmt Last modified time 1609459200 1612137600
gir Segmenting yes no
pl Playlist index 1 2
t Timestamp (playback start) 1m30s 90s
id Video ID oHg5SJYRHA0
v Video ID dQw4w9WgXcQ
gcr Geo region IN CA
hl Language fr pt
cc_load_policy Closed captions 1 0
cc_lang_pref Preferred caption language cn kr
autoplay Autoplay 1 0
fs Fullscreen button 1 0
rel Related videos at end 1 0
modestbranding Modest Logo 1 0

@raszpl
Copy link
Contributor

raszpl commented May 24, 2024

You cant manipulate most of those parameters, whole URLs are crypto signed and checksummed.
As I said before doing what this extension does is VERY invasive. This one for example uses
chrome.webRequest.onBeforeRequest.addListener
to intercept already checksummed and crypto signed audio track URL in flight. Its the kind of thing Google bans extensions for (YT APIs Terms of Service) https://www.reddit.com/r/grayjay/comments/1ajv2ur/apparently_grayjay_got_a_cease_and_desist_letter/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

4 participants