Amazon Video - subtitle downloader

Allows you to download subtitles from Amazon Video

< Feedback on Amazon Video - subtitle downloader

Review: Good - script works

§
Posted: 12.10.2024.

Script doesn't initialize if some episodes are not available for watching/downloading etc.

Specifically, I'm looking at this: https://123.456.ro/share/2024/10/chrome_tocGu4CsBn.png

Episode 1 is, for some reasons, listed 3 times, but only 1 is watchable. I'm not sure why Amazon lists it like this for my country, but this is making the script not trigger for this specific season.

The Console will show:

Amazon Video - subtitle downloader.user.js:223 xhrHijacker - inject
Amazon Video - subtitle downloader.user.js:229 xhrHijacker - injecting code: 0.212158203125 ms
31bJewCvY-L.js:4 Error logged with the Track&Report JS errors API(http://tiny/1covqr6l8/wamazindeClieUserJava): {"m":"Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.","name":"Error","csm":"v5 ueLogError stack","logLevel":"WARN","attribution":"ATVDetail:Season","pageURL":"https://www.primevideo.com/region/eu/detail/0JCAH3NXELVLV2NURB1T7TO1YH/ref=atv_dp_season_select_s4","f":"https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors","l":"2","s":["Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.","at fo (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:168378)","at ql (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:203874)","at _s (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:228737)","at ws (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:228619)","at bs (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:228530)","at os (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:223580)","at P (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:250663)","at MessagePort.I (https://m.media-amazon.com/images/I/818a6TLagRL.js?DVWebNode_vendors:2:251195)"],"t":1101} {m: 'Minified React error #418; visit https://reactjs.o… for full errors and additional helpful warnings.', name: 'Error', type: undefined, csm: 'v5 ueLogError stack', logLevel: 'WARN', …}
B @ 31bJewCvY-L.js:4
C @ 31bJewCvY-L.js:5
_logRTLA @ ref=atv_dp_season_select_s4:90
_warnWithError @ ref=atv_dp_season_select_s4:90
r.untangleOverload @ ref=atv_dp_season_select_s4:90
warn @ ref=atv_dp_season_select_s4:90
a @ ref=atv_dp_season_select_s4:90
_log @ ref=atv_dp_season_select_s4:90
(anonymous) @ ref=atv_dp_season_select_s4:90
r.fireAndForgetPromise @ ref=atv_dp_season_select_s4:90
(anonymous) @ ref=atv_dp_season_select_s4:90
warn @ ref=atv_dp_season_select_s4:90
s @ 91kctCSqphL.js?DVWebNode_commons:2
(anonymous) @ 818a6TLagRL.js?DVWebNode_vendors:2
Ps @ 818a6TLagRL.js?DVWebNode_vendors:2
os @ 818a6TLagRL.js?DVWebNode_vendors:2
P @ 818a6TLagRL.js?DVWebNode_vendors:2
I @ 818a6TLagRL.js?DVWebNode_vendors:2

Seems these could be filtered a bit when querying the elements. Here's a sample of how the first 2 episodes in the screenshot above looks:

<li id="av-ep-episodes-0" data-aliases="" class="c5qQpO" data-testid="episode-list-item" style="height: 226.5px;"><div class="_2MB5uV GMyJNy"><input id="selector-amzn1.dv.gti.0a271a3e-0f21-4f39-bdd5-51dc9d3bb4f8" name="highlight-list-selector" class="_6tpIy4" type="checkbox"><div data-automation-id="ep-title-episodes-0" class="dCocJw"><div class="wfjdyJ"><label class="lzsdji" for="selector-amzn1.dv.gti.0a271a3e-0f21-4f39-bdd5-51dc9d3bb4f8"></label><div><div class="izvPPq"><span class="_36qUej izvPPq"><span>S4 E1</span><span class="Z7ThIH"> - </span><span class="P1uAb6">Scarlet Ribbons</span></span></div><div class="Pol9sO"></div></div></div></div><div class="Sb08Os"></div><div class="st02Fe ci7S35" data-testid="episode-image"><div class="_2WUZp7" data-testid="episode-packshot"><div class="Ypm4jh" data-is-watched="false"><div class="om7nme" style="aspect-ratio:16/9"><picture><source type="image/webp" srcset="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX360_FMwebp_.jpg 360w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX480_FMwebp_.jpg 480w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMwebp_.jpg 720w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1080_FMwebp_.jpg 1080w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1440_FMwebp_.jpg 1440w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1920_FMwebp_.jpg 1920w" sizes="(max-width: 28em) 182px, (max-width: 55em) 195px, (max-width: 80em) 324px, (max-width: 100em) 408px, (max-width: 150em) 555px, 1920px"><source type="image/jpeg" srcset="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX360_FMjpg_.jpg 360w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX480_FMjpg_.jpg 480w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMjpg_.jpg 720w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1080_FMjpg_.jpg 1080w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1440_FMjpg_.jpg 1440w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1920_FMjpg_.jpg 1920w" sizes="(max-width: 28em) 182px, (max-width: 55em) 195px, (max-width: 80em) 324px, (max-width: 100em) 408px, (max-width: 150em) 555px, 1920px"><img alt="" class="FHb5CR Ah1hNY" style="aspect-ratio:16/9" src="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMjpg_.jpg" data-testid="base-image" loading="eager"></picture></div></div></div></div><div class="_1wFEYz ci7S35" data-testid="episode-metadata"><div class="riRKnh"><div data-testid="episode-release-date">January 1, 2011</div><div data-testid="episode-runtime">41min</div><span aria-label="Not rated." class="_3U8JX- _2zZuYJ _1TNG7J fbl-maturity-rating _1UHwej fbl-label-badge" data-testid="rating-badge" data-automation-id="rating-badge" role="text" dir="ltr">NR</span></div></div><div class="_1+KXv2 ci7S35"><div class="p-jAFk _1zr6Jb" data-automation-id="synopsis-amzn1.dv.gti.0a271a3e-0f21-4f39-bdd5-51dc9d3bb4f8"><div class="mlmPSf -12Ln6 hjuloM"><input id="synopsis-amzn1.dv.gti.0a271a3e-0f21-4f39-bdd5-51dc9d3bb4f8" class="wgGFDs" type="checkbox" disabled="" checked=""><label for="synopsis-amzn1.dv.gti.0a271a3e-0f21-4f39-bdd5-51dc9d3bb4f8" class="_1W5VSv"></label><div class="_3qsVvm e8yjMf"><div dir="auto">In prison for killing his nemesis, Patrick Jane must prove that the man he shot really was the elusive serial killer, Red John (guest star Bradley Whitford.)</div></div></div></div></div><div class="I00Zqz ci7S35"><div class="N9hMx3 NNb0rv"></div></div><div class="js-episode-offers xy8xpL ci7S35"><div class="x-raAF" data-testid="dp-btf-action-box"><div><div class="cqF7Dt Lbk72- vhfUZR" data-testid="buy-box-msg"><span class="_36qUej">This video is currently unavailable</span></div><div class="abwJ5F _16AW_S _2LF_6p JBdyB4"><div class="abwJ5F _2iPvJd _2LF_6p kLWjrV"></div></div></div></div></div></div></li>


<li id="av-ep-episodes-1" data-aliases="" class="c5qQpO" data-testid="episode-list-item" style=""><div class="_2MB5uV"><input id="selector-amzn1.dv.gti.8ab3421b-0b25-b52a-d59e-38d18deb3ffb" name="highlight-list-selector" class="_6tpIy4" type="checkbox"><div data-automation-id="ep-title-episodes-1" class="dCocJw"><div class="IPL4PS"><a data-testid="episodes-playbutton" data-automation-id="episodes-playbutton" aria-label="1. {title}" testid="episodes-playbutton" automationid="episodes-playbutton" class="_3fru6t _1x6UOo fbl-play-btn" role="button" aria-disabled="false" href="/region/eu/detail/0ND7WHNKCFREROMMGQZGEY1M2J/ref=atv_dp_btf_el_prime_sd_tv_play_t1ADAAAAAA0wg0?autoplay=1&amp;t=0"><span aria-hidden="true"><div class="bPQjm1"><svg snipped></svg></div></a></label></div><div class="st02Fe ci7S35" data-testid="episode-image"><div class="_2WUZp7" data-testid="episode-packshot"><div class="Ypm4jh" data-is-watched="false"><div class="om7nme" style="aspect-ratio:16/9"><picture><source type="image/webp" srcset="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX360_FMwebp_.jpg 360w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX480_FMwebp_.jpg 480w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMwebp_.jpg 720w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1080_FMwebp_.jpg 1080w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1440_FMwebp_.jpg 1440w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1920_FMwebp_.jpg 1920w" sizes="(max-width: 28em) 182px, (max-width: 55em) 195px, (max-width: 80em) 324px, (max-width: 100em) 408px, (max-width: 150em) 555px, 1920px"><source type="image/jpeg" srcset="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX360_FMjpg_.jpg 360w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX480_FMjpg_.jpg 480w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMjpg_.jpg 720w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1080_FMjpg_.jpg 1080w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1440_FMjpg_.jpg 1440w, https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX1920_FMjpg_.jpg 1920w" sizes="(max-width: 28em) 182px, (max-width: 55em) 195px, (max-width: 80em) 324px, (max-width: 100em) 408px, (max-width: 150em) 555px, 1920px"><img alt="" class="FHb5CR Ah1hNY" style="aspect-ratio:16/9" src="https://m.media-amazon.com/images/S/pv-target-images/0108f691437c2a39526b43d26b8c7d487ccd85965ca3925af28ae3d7291dbff5._BR-6_AC_SX720_FMjpg_.jpg" data-testid="base-image" loading="eager"></picture></div></div><div class="OUwe3b"><a data-testid="episodes-playbutton" data-automation-id="episodes-playbutton" aria-label="1. {title}" testid="episodes-playbutton" automationid="episodes-playbutton" class="mddriI _3fru6t _1x6UOo fbl-play-btn" role="button" aria-disabled="false" href="/region/eu/detail/0ND7WHNKCFREROMMGQZGEY1M2J/ref=atv_dp_btf_el_prime_sd_tv_play_t1ADAAAAAA0wg0?autoplay=1&amp;t=0"><span aria-hidden="true"><div class="bPQjm1"><svg snipped></svg></span><span class="_36qUej">Included with Prime</span></div></div><div class="js-episode-offers xy8xpL ci7S35"><div class="x-raAF" data-testid="dp-btf-action-box"><div><div class="abwJ5F _16AW_S _2LF_6p JBdyB4"><div class="abwJ5F _2iPvJd _2LF_6p kLWjrV"></div></div></div></div></div></div></li>

(notice I trimmed the <svg> from the 2nd item).

With my inexperienced look, I could say that data-testid="download-button-IDLE" data-automation-id="download-button-IDLE" is present on the episodes that are available to watch/download, while the "unavailable" ones don't have this. Maybe that's something the code could check for when deciding which items to parse/attach to.

§
Posted: 12.10.2024.
Edited: 12.10.2024.

Nothing I can do about it. For my script to work it has to grab a link with all authentication params, etc. And if the first episode can't be opened - Amazon won't load the preview, and my script can't get the URL.

The script responsible for determining which episode can be watched and which can't doesn't even run because of that.

Can you click on that watchable episode? I don't have prime so I don't remember what happens. Does it open a new tab? Load another page? IDK.

§
Posted: 12.10.2024.

Oh. You are correct.

Playing the first available episode does indeed fix the download when returning to the Season view.

Thank you very much.

Post reply

Sign in to post a reply.