Skip to content

Commit 60f02b1

Browse files
committed
vimeo: use android client for session
1 parent e4b5388 commit 60f02b1

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

api/src/processing/services/vimeo.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const resolutionMatch = {
1717

1818
const genericHeaders = {
1919
Accept: 'application/vnd.vimeo.*+json; version=3.4.10',
20-
'User-Agent': 'Vimeo/11.13.0 (com.vimeo; build:250619.102023.0; iOS 18.5.0) Alamofire/5.9.0 VimeoNetworking/5.0.0',
21-
Authorization: 'Basic MTMxNzViY2Y0NDE0YTQ5YzhjZTc0YmU0NjVjNDQxYzNkYWVjOWRlOTpHKzRvMmgzVUh4UkxjdU5FRW80cDNDbDhDWGR5dVJLNUJZZ055dHBHTTB4V1VzaG41bEx1a2hiN0NWYWNUcldSSW53dzRUdFRYZlJEZmFoTTArOTBUZkJHS3R4V2llYU04Qnl1bERSWWxUdXRidjNqR2J4SHFpVmtFSUcyRktuQw==',
22-
'Accept-Language': 'en-US,en;q=0.9',
20+
'User-Agent': 'com.vimeo.android.videoapp (Google, Pixel 7a, google, Android 16/36 Version 11.8.1) Kotlin VimeoNetworking/3.12.0',
21+
Authorization: 'Basic NzRmYTg5YjgxMWExY2JiNzUwZDg1MjhkMTYzZjQ4YWYyOGEyZGJlMTp4OGx2NFd3QnNvY1lkamI2UVZsdjdDYlNwSDUrdm50YzdNNThvWDcwN1JrenJGZC9tR1lReUNlRjRSVklZeWhYZVpRS0tBcU9YYzRoTGY2Z1dlVkJFYkdJc0dMRHpoZWFZbU0reDRqZ1dkZ1diZmdIdGUrNUM5RVBySlM0VG1qcw==',
22+
'Accept-Language': 'en',
2323
}
2424

2525
let bearer = '';
@@ -28,19 +28,16 @@ const getBearer = async (refresh = false) => {
2828
if (bearer && !refresh) return bearer;
2929

3030
const oauthResponse = await fetch(
31-
`https://api.vimeo.com/oauth/authorize/client?sizes=216,288,300,360,640,960,1280,1920&cdm_type=fairplay`,
31+
'https://api.vimeo.com/oauth/authorize/client',
3232
{
3333
method: 'POST',
34-
body: JSON.stringify({
35-
scope: 'public private purchased create edit delete interact upload stats',
34+
body: new URLSearchParams({
35+
scope: 'private public create edit delete interact upload purchased stats',
3636
grant_type: 'client_credentials',
37-
// device_identifier is a long ass base64 string of seemingly
38-
// random data, but it doesn't seem to be required, so we just omit it lol
39-
device_identifier: '',
40-
}),
37+
}).toString(),
4138
headers: {
4239
...genericHeaders,
43-
'Content-Type': 'application/json',
40+
'Content-Type': 'application/x-www-form-urlencoded',
4441
}
4542
}
4643
)

0 commit comments

Comments
 (0)