# URL transcodin

**URL:** <https://forums.plex.tv/t/url-transcodin/22524>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [October 22, 2012, 12:23pm UTC](https://forums.plex.tv/t/url-transcodin/22524 "2012-10-22T12:23:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremb](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeremb](https://forums.plex.tv/u/jeremb)\
**Post date:** [October 22, 2012, 12:23pm UTC](https://forums.plex.tv/t/url-transcodin/22524/1 "2012-10-22T12:23:06Z")

</div>

HI,  
  
  
  
I try to create a web plex client. I searched on the forum and i don’t find the answer to my problem.  
  
  
  
So, can someone explain me how generate a url transcoding?  
  
  
  
I try to execute this

```auto

<br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br />
<head><br />
<title>Plex Video Player</title><br />
<style type="text/css"><br />
body{<br />
        margin:0;<br />
        padding:0;<br />
        background-color: #000000;<br />
        }<br />
</style><br />
</head><br />
<body><br />
<br />
<script type="text/javascript" src="base64.js"></script><br />
<script type="text/javascript" src="jssha256.js"></script><br />
<br />
<script type="text/javascript"><br />
<br />
publicKey = "KQMIY6GATPC63AIMC4R2";<br />
privateKey = decode64("k3U6GLkZOoNIoSgjDshPErvqMIFdE0xMTx8kgsrhnC0=");<br />
<br />
//from Plex Media Server<br />
part = encodeURIComponent('/library/parts/12083/file.avi');<br />
<br />
add= "http://192.168.2.12:32400";<br />
<br />
myurl = "/video/:/transcode/generic.flv?format=flv&videoCodec=flv&videoBitrate=1000&audioCodec=libmp3lame&audioBitrate=128&size=624x336"<br />
myurl = myurl + "&fakeContentLength=2000000000&url=http%3A%2F%2F192.168.2.12%3A32400" + part + "&3g=0&httpCookies=&userAgent=";<br />
<br />
time = Math.round(new Date().getTime() / 1000);<br />
<br />
msg = myurl+"@"+time;<br />
<br />
redirectURL = encodeURIComponent(msg);<br />
<br />
HMAC_SHA256_init(privateKey);<br />
HMAC_SHA256_write(msg);<br />
mac = HMAC_SHA256_finalize();<br />
msg = encode64(array_to_string(mac));<br />
<br />
URL=add+redirectURL+encodeURIComponent("&X-Plex-Access-Key="+publicKey+"&X-Plex-Access-Code="+array_to_string(mac))+encodeURIComponent("&X-Plex-Access-Time="+time);<br />
<br />
document.write("<table cellpadding='0' cellspacing='0' height='100%' width='100%' style='text-align:center;'><tr><td>");<br />
document.write("<embed src='http://192.168.2.12/videoplayer.swf?streamUrl="); //from http://mycast.orb.com/orb/resources/common/videoplayer.swf<br />
document.write(URL);<br />
document.write(" quality='best' scale='noborder' width='100%' height='100%' name='videoplayer' align='middle' allowScriptAccess='sameDomain' ");<br />
document.write(" type='application/x-shockwave-flash' flashvars='file=");<br />
document.write(URL);<br />
document.write("' allowFullScreen='true' pluginspage='https://www.macromedia.com/go/getflashplayer' /></object></td></tr></table>");<br />
<br />
<br />
</script><br />
<br />
</body><br />
</html><br />

```

  
  
But i got a 330 (net::ERR\_CONTENT\_DECODING\_FAILED) error.  
  
Thank u

---

<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/url-transcodin/22524/2 "2019-12-20T22:21:11Z")

</div>

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