Skip to content

Conversation

absidue
Copy link
Member

@absidue absidue commented Apr 16, 2025

Fix user-agent and referer for Innertube requests

Pull Request Type

  • Bugfix

Description

This pull request fixes the user-agent in the request payload not matching the user-agent header, as YouTube.js was chosing a random one for the request payload and also fixes the referer header for the session data request.

Thanks to @AudricV for discovering these inconsistencies.

Testing

Test a few videos and check that they play correctly. While I wasn't able to confirm if this fixes the IP block issue that users have been reporting, as I couldn't reproduce that issue myself, this should hopefully help the situation. If someone can confirm that this does solve the issue we can link it with a closes line.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 765452d

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) April 16, 2025 21:40
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Apr 16, 2025
@absidue absidue changed the title Fix user-agent and referer for Innertube Fix user-agent and referer for Innertube requests Apr 16, 2025
@FreeTubeBot FreeTubeBot merged commit 82ba933 into FreeTubeApp:development Apr 20, 2025
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Apr 20, 2025
@absidue absidue deleted the fix-user-agent branch April 20, 2025 18:46
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Apr 20, 2025
* development: (25 commits)
  Remove author and authorId from the required list of video keys for playlists (FreeTubeApp#7083)
  Translated using Weblate (Odia)
  Translated using Weblate (Nepali)
  Translated using Weblate (Hindi)
  Translated using Weblate (Sinhala)
  Translated using Weblate (Slovenian)
  Translated using Weblate (Catalan)
  Translated using Weblate (Assamese)
  Translated using Weblate (German)
  replace icns mac icon with hq one (FreeTubeApp#7212)
  Fix user-agent and referer for Innertube requests (FreeTubeApp#7213)
  Use new images (FreeTubeApp#7236)
  Fix the channel name and ID missing on the channel home tab (FreeTubeApp#7232)
  Translated using Weblate (Odia)
  Translated using Weblate (Georgian)
  Translated using Weblate (Bosnian)
  Translated using Weblate (Sinhala)
  Translated using Weblate (English (United Kingdom))
  Translated using Weblate (Assamese)
  Fix live streams not working on the local API (FreeTubeApp#7233)
  ...

# Conflicts:
#	src/renderer/views/Hashtag/Hashtag.vue
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Apr 20, 2025
…rent

* feature/hide-member-only-videos: (25 commits)
  Remove author and authorId from the required list of video keys for playlists (FreeTubeApp#7083)
  Translated using Weblate (Odia)
  Translated using Weblate (Nepali)
  Translated using Weblate (Hindi)
  Translated using Weblate (Sinhala)
  Translated using Weblate (Slovenian)
  Translated using Weblate (Catalan)
  Translated using Weblate (Assamese)
  Translated using Weblate (German)
  replace icns mac icon with hq one (FreeTubeApp#7212)
  Fix user-agent and referer for Innertube requests (FreeTubeApp#7213)
  Use new images (FreeTubeApp#7236)
  Fix the channel name and ID missing on the channel home tab (FreeTubeApp#7232)
  Translated using Weblate (Odia)
  Translated using Weblate (Georgian)
  Translated using Weblate (Bosnian)
  Translated using Weblate (Sinhala)
  Translated using Weblate (English (United Kingdom))
  Translated using Weblate (Assamese)
  Fix live streams not working on the local API (FreeTubeApp#7233)
  ...
@Eiji7
Copy link

Eiji7 commented Apr 24, 2025

@absidue "If someone can confirm that this does solve the issue we can link it with a closes line."

After downloading the 0.23.4 Beta for some time I was unable to fetch video list from subscriptions (it was just empty without any error). I have searched for desired video and watched it and then I was able to fetch all videos, weird but in previous version I had IP block error and I needed to open the video in mpv. Right now I'm playing the 2nd video and it seems to be fixed. Will give more details if I would have any problems related to this PR. Thanks for your fix! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants