Amazon Video - subtitle downloader

Allows you to download subtitles from Amazon Video

< Feedback de Amazon Video - subtitle downloader

Pergunta/Comentário

§
Publicado em: 02/12/2024
Editado em: 02/12/2024

Not working anymore with Firefox 133.0 and the version 1.9.15 of the script, no button appears in order to download them

§
Publicado em: 02/12/2024

I don't have Prime so I test on free videos/series.

https://www.amazon.de/gp/video/detail/B0CH8D9MD4/
https://www.amazon.de/gp/video/detail/B0D1GTMSP3/

Works fine on both of these. Firefox 133.0, UserScript version 1.9.15. Tested with both Greasemonkey 4.13 and Tampermonkey 5.3.2.

§
Publicado em: 03/12/2024
Editado em: 03/12/2024

same as ganda234, with prime video.com and chrome Version 131.0.6778.86 and Tampermonkey 5.3.2 and 1.9.15 of the script not working

§
Publicado em: 03/12/2024

update: same problem with firefox

§
Publicado em: 03/12/2024

Can't test on primevideo.com, but as I said, works fine on amazon.de. If the design changed then you need to provide more info, like the HTML page. Send it to me in a private message.

§
Publicado em: 03/12/2024

I don't think it's a layout problem. There's a problem with the init, because /GetPlaybackResources doesn't exist

if i add args[1] in console log

console.log("debug",args[1])
if(args[1].indexOf('/GetPlaybackResources') > -1) {

this is the output

debug https://cloudfront.xp-assets.aiv-cdn.net/packages/ATVWebPlayerSDK-1.0/prod/ATVWebPlayerSDK.js
debug https://unagi.amazon.com/1/events/com.amazon.csm.csa.prod
debug https://unagi.amazon.com/1/events/com.amazon.csm.csa.prod
debug https://unagi.amazon.com/1/events/com.amazon.csm.csa.prod
debug https://unagi.amazon.com/1/events/com.amazon.csm.csa.prod
§
Publicado em: 03/12/2024

And what happens when you start watching the movie/episode?

§
Publicado em: 03/12/2024

never mind, it seems to work again.
maybe a temporary problem or some amz test

it's extremely slow to fetch the info, about 10-30sec, but it might be my problem

§
Publicado em: 03/12/2024
Editado em: 03/12/2024

Still nothing for me, waited 10-30s but still nothing. On the amazon.de seems to work, tested it yesterday.

Can't test on primevideo.com, but as I said, works fine on amazon.de. If the design changed then you need to provide more info, like the HTML page. Send it to me in a private message.

Messaged you with the HTML page

§
Publicado em: 03/12/2024

since this Sunday I have a bug with the parental control, which could be related to the access to the info on the videos.
even though it is disabled in the settings, on some videos the pin is still requested.

is it the same for you?

§
Publicado em: 04/12/2024

@ganda234 As grea75 said, it's not a problem with HTML. And like I said, start watching a movie/episode and see what happens. If you can watch it - it should load the correct URL, init function should fire and add download buttons. Don't refresh the page. Just start watching and then click on the X button to close the player.

§
Publicado em: 07/12/2024

There's no longer /GetPlaybackResources on primevideo.com. Now it's /GetVodPlaybackResources, and the method is POST, not GET (you need to send a JSON)

§
Publicado em: 08/12/2024

Then I need to see what's in that JSON data. (Don't post it publicly here, it may contain sensitive data.) And I need to see a request for getting subtitle links. Primevideo is not even available here, it redirects me to Amazon when I log in.

§
Publicado em: 20/12/2024

I'm just checking in, seeing that the code still hasn't been updated. Didn't you get any request example or have you just not solved it yet?

§
Publicado em: 21/12/2024
Editado em: 21/12/2024

Solution.
New xhrHijacker:

xhrHijacker(function(xhr, id, origin, args) {
if(!initialied && origin === 'open')
//if(origin === 'open')
if(args[1].indexOf('/GetVodPlaybackResources') > -1 || args[1].indexOf('/GetPlaybackResources') > -1) {
init(args[1])
.catch(error => {
console.log(error);
alert(`subtitle downloader error: ${error.message}`);
});
}
});


New parseUrl:

function parseURL(url) {
if (url.includes("GetVodPlaybackResources")){
const urlObj = new URL(url);
const urlHostname = urlObj.hostname;
const deviceID = urlObj.searchParams.get("deviceID");
const deviceTypeID = urlObj.searchParams.get("deviceTypeID");
const marketplaceID = urlObj.searchParams.get("marketplaceID");
return `https://${urlHostname}/cdp/catalog/GetPlaybackResources?consumptionType=Streaming&desiredResources=CatalogMetadata%2CForcedNarratives%2CSubtitleUrls&deviceID=${deviceID}&deviceTypeID=${deviceTypeID}&firmware=1&gascEnabled=true&marketplaceID=${marketplaceID}&resourceUsage=CacheResources&videoMaterialType=Feature&operatingSystemName=Windows&operatingSystemVersion=10.0&titleDecorationScheme=primary-content&subtitleFormat=TTMLv2&uxLocale=en_US&asin=`;
} else if (url.includes("GetPlaybackResources")){
let filter = ['consumptionType', 'deviceID', 'deviceTypeID', 'firmware', 'gascEnabled', 'marketplaceID', 'userWatchSessionId', 'videoMaterialType', 'clientId', 'operatingSystemName', 'operatingSystemVersion', 'customerID', 'token'];
let urlParts = url.split('?');
let params = ['desiredResources=CatalogMetadata%2CSubtitleUrls%2CForcedNarratives'];
urlParts[1].split('&').forEach(function(param) {
let p = param.split('=');
if(filter.indexOf(p[0]) > -1)
params.push(param);
});
params.push('resourceUsage=CacheResources');
params.push('titleDecorationScheme=primary-content');
params.push('subtitleFormat=TTMLv2');
params.push('asin=');
urlParts[1] = params.join('&');
return urlParts.join('?');
}
}

Enviar resposta

Entre para publicar uma resposta.