# Trascoding/key problems

**URL:** <https://forums.plex.tv/t/trascoding-key-problems/22617>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [October 25, 2012, 8:20am UTC](https://forums.plex.tv/t/trascoding-key-problems/22617 "2012-10-25T08:20:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ube\_1](https://avatars.discourse-cdn.com/v4/letter/u/779978/32.png) [@Ube\_1](https://forums.plex.tv/u/Ube_1)\
**Post date:** [October 25, 2012, 8:20am UTC](https://forums.plex.tv/t/trascoding-key-problems/22617/1 "2012-10-25T08:20:35Z")

</div>

Hello,  
  
  
  
I’m trying to access the transcoder using perl and LWP but I run into “ERROR - Client ‘KQMIY6GATPC63AIMC4R2’ access code is incorrect.” in server log and 401 return code. I’m sure it’s something I’ve misunderstood with the url since when I input the same parameters in the test.htm code I get the same access code generated. So, what am I doing wrong?  
  
  
  
  
  
  
  
Library entry for the video I’, trying to decode:

```auto

<Video ratingKey="40641" key="/library/metadata/40641" studio="20th Century Fox" type="movie" title="Abraham Lincoln: Vampire Hunter" contentRating="R" summary="Visionary filmmakers Tim Burton and Timur Bekmambetov reinvent the time-honored genre and present the terrifying creatures of the night as they were meant to be experienced -- as fierce, visceral, intense and bloodthristy. Abraham Lincoln: Vampire Hunter brings to the screen the secret life of our nation's favorite president...as history's greatest hunter of the undead. -- (C) Official Site" rating="5.5" viewOffset="92160" year="2012" thumb="/library/metadata/40641/thumb?t=1350376147" art="/library/metadata/40641/art?t=1350376147" duration="6300000" originallyAvailableAt="2012-06-19" addedAt="1350135392" updatedAt="1350376147"><br />
	<Media id="37817" duration="6300555" bitrate="5945" width="1280" height="536" aspectRatio="2.35" audioChannels="6" audioCodec="dca" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="24p"><br />
		<Part id="37817" key="/library/parts/37817/file.mkv" duration="6300555" file="/mnt/movies/Abraham.Lincoln.Vampire.Hunter.2012.720p.BluRay.x264-DAA/daa-alvh-720p.mkv" size="4682326613" container="mkv"/><br />
	</Media><br />
	<Genre tag="Action & Adventure"/><br />
	<Genre tag="Horror"/><br />
	<Writer tag="Seth Grahame-Smith"/><br />
	<Writer tag="Simon Kinberg"/><br />
	<Director tag="Timur Bekmambetov"/><br />
	<Country tag="USA"/><br />
	<Role tag="Benjamin Walker"/><br />
	<Role tag="Dominic Cooper"/><br />
	<Role tag="Anthony Mackie"/><br />
</Video>

```

  
Perl script output:  

```auto

<br />
pre sha256 (test code 'myurl'): /video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&ratingKey=40641&offset=0&quality=5&url=http%3A%2F%2Flocalhost%3A32400%2Flibrary%2Fparts%2F37817%2Ffile.mkv&3g=0&httpCookies=&userAgent=@1351124094<br />
<br />
post sha256(test code 'msg'): efVsD01UEpw3wvVZRqrskyE0VNVLNEaz3Bc9FXGuAEE=<br />
<br />
headers:<br />
$VAR1 = bless( {<br />
                 'x-plex-access-code' => 'efVsD01UEpw3wvVZRqrskyE0VNVLNEaz3Bc9FXGuAEE=',<br />
                 'x-plex-access-time' => '1351124094',<br />
                 'x-plex-access-key' => 'KQMIY6GATPC63AIMC4R2'<br />
               }, 'HTTP::Headers' );<br />
<br />
Get URL:<br />
http://plex:32400/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&ratingKey=40641&offset=0&quality=5&url=http%3A%2F%2Flocalhost%3A32400%2Flibrary%2Fparts%2F37817%2Ffile.mkv&3g=0&httpCookies=&userAgent=@1351124094<br />
<br />
urldecoded for readability:<br />
http://plex:32400/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&ratingKey=40641&offset=0&quality=5&url=http://localhost:32400/library/parts/37817/file.mkv&3g=0&httpCookies=&userAgent=@1351124094<br />
<br />
HTTP response: 401 Unauthorized<br />

```

  
  
test.htm output:  

```auto

X-Plex-Access-Key=KQMIY6GATPC63AIMC4R2<br />
X-Plex-Access-Time=1351124094<br />
X-Plex-Access-Code=efVsD01UEpw3wvVZRqrskyE0VNVLNEaz3Bc9FXGuAEE=

```

  
  
server.log output:  

```auto

Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - Request: GET /video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&ratingKey=40641&offset=0&quality=5&url=http%3A%2F%2Flocalhost%3A32400%2Flibrary%2Fparts%2F37817%2Ffile.mkv&3g=0&httpCookies=&userAgent=@1351124094 [172.16.1.3:56224] (1 live)<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * identifier => com.plexapp.plugins.library<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * ratingKey => 40641<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * offset => 0<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * quality => 5<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * url => http://localhost:32400/library/parts/37817/file.mkv<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * 3g => 0<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * httpCookies =><br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - * userAgent => @1351124094<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - Cookie header in secure request:<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] DEBUG - Checking cookie ''<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] ERROR - Client 'KQMIY6GATPC63AIMC4R2' access code is incorrect.<br />
Oct 25, 2012 10:11:59 [0x7ffdb67fc700] VERBOSE - Request: GET /video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&ratingKey=40641&offset=0&quality=5&url=http%3A%2F%2Flocalhost%3A32400%2Flibrary%2Fparts%2F37817%2Ffile.mkv&3g=0&httpCookies=&userAgent=@1351124094 complete<br />

```

---

<div class="post-metadata">

**Author:** ![BlackP](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@BlackP](https://forums.plex.tv/u/BlackP)\
**Post date:** [October 25, 2012, 1:38pm UTC](https://forums.plex.tv/t/trascoding-key-problems/22617/2 "2012-10-25T13:38:39Z")

</div>

If you have activ the DTS Downmix, than deactivate it and the errors are fixed.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 10:21pm UTC](https://forums.plex.tv/t/trascoding-key-problems/22617/3 "2019-12-20T22:21:38Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
