[PR #403] [MERGED] Oauth refresh on request #611

Closed
opened 2026-02-27 23:01:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigma67/ytmusicapi/pull/403
Author: @zeitmeister
Created: 6/19/2023
Status: Merged
Merged: 7/3/2023
Merged by: @sigma67

Base: masterHead: oauth-refresh-on-request


📝 Commits (10+)

  • ed6ba7b updating token on every request if auth is oauth
  • 25014cc remove print line
  • 09fbf2f headers only updated if auth is oauth
  • d40f283 Merge branch 'sigma67:master' into oauth-refresh-on-request
  • dbf4f43 some refactoring
  • eeef723 Merge branch 'oauth-refresh-on-request' of github.com:zeitmeister/ytmusicapi into oauth-refresh-on-request
  • f754f8b dont know what happened here
  • 4a31cf7 xMerge branch 'oauth-refresh-on-request' of github.com:zeitmeister/ytmusicapi into oauth-refresh-on-request
  • a02b86b Merge branch 'sigma67:master' into oauth-refresh-on-request
  • 533d5b1 check for self.auth

📊 Changes

2 files changed (+19 additions, -7 deletions)

View changed files

📝 ytmusicapi/auth/headers.py (+3 -5)
📝 ytmusicapi/ytmusic.py (+16 -2)

📄 Description

This fix should update so that for every request to ytmusic the code checks if the access token needs refreshing and refreshes it if that's the case.

However, the headers object are updated on every request, regardless if the token needs refreshing or not. This is probably not cpu heavy by any means but should perhaps be looked at in another iteration. or when i have more time...


🔄 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/sigma67/ytmusicapi/pull/403 **Author:** [@zeitmeister](https://github.com/zeitmeister) **Created:** 6/19/2023 **Status:** ✅ Merged **Merged:** 7/3/2023 **Merged by:** [@sigma67](https://github.com/sigma67) **Base:** `master` ← **Head:** `oauth-refresh-on-request` --- ### 📝 Commits (10+) - [`ed6ba7b`](https://github.com/sigma67/ytmusicapi/commit/ed6ba7b4e8e2048594c1db949293f69c96166f40) updating token on every request if auth is oauth - [`25014cc`](https://github.com/sigma67/ytmusicapi/commit/25014cc8286759c022549659b60696490de8924b) remove print line - [`09fbf2f`](https://github.com/sigma67/ytmusicapi/commit/09fbf2f4567833b45dcedcaf59a955a0a013fcd6) headers only updated if auth is oauth - [`d40f283`](https://github.com/sigma67/ytmusicapi/commit/d40f2835d0fc6b5396c9d464c441bf2c381fedf4) Merge branch 'sigma67:master' into oauth-refresh-on-request - [`dbf4f43`](https://github.com/sigma67/ytmusicapi/commit/dbf4f432faa50f52916d27d12054f5e474443a13) some refactoring - [`eeef723`](https://github.com/sigma67/ytmusicapi/commit/eeef723f4401d9c079bf9bdf243c258514cda9ea) Merge branch 'oauth-refresh-on-request' of github.com:zeitmeister/ytmusicapi into oauth-refresh-on-request - [`f754f8b`](https://github.com/sigma67/ytmusicapi/commit/f754f8b6fa6487e7ce983d985cd45419ac7842ac) dont know what happened here - [`4a31cf7`](https://github.com/sigma67/ytmusicapi/commit/4a31cf7e1fadaa99acef4ead1d4a4ade4073478c) xMerge branch 'oauth-refresh-on-request' of github.com:zeitmeister/ytmusicapi into oauth-refresh-on-request - [`a02b86b`](https://github.com/sigma67/ytmusicapi/commit/a02b86b9090fd867ff1ce9145d2882faecec8e36) Merge branch 'sigma67:master' into oauth-refresh-on-request - [`533d5b1`](https://github.com/sigma67/ytmusicapi/commit/533d5b1dff31a8eb7cd20a22016e74f4f806c53d) check for self.auth ### 📊 Changes **2 files changed** (+19 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `ytmusicapi/auth/headers.py` (+3 -5) 📝 `ytmusicapi/ytmusic.py` (+16 -2) </details> ### 📄 Description This fix should update so that for every request to ytmusic the code checks if the access token needs refreshing and refreshes it if that's the case. However, the headers object are updated on every request, regardless if the token needs refreshing or not. This is probably not cpu heavy by any means but should perhaps be looked at in another iteration. or when i have more time... --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:01:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#611
No description provided.