From 60633ae9a03bd0b7008870509b47800a16969b5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Wed, 19 Oct 2016 22:00:24 +0200
Subject: [PATCH] [openload] Fix extraction.

Fixes #10408
---
 youtube_dl/extractor/openload.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/youtube_dl/extractor/openload.py b/youtube_dl/extractor/openload.py
index 4f5175136..6cf7e4a77 100644
--- a/youtube_dl/extractor/openload.py
+++ b/youtube_dl/extractor/openload.py
@@ -70,10 +70,15 @@ class OpenloadIE(InfoExtractor):
             r'<span[^>]*>([^<]+)</span>\s*<span[^>]*>[^<]+</span>\s*<span[^>]+id="streamurl"',
             webpage, 'encrypted data')
 
+        magic = compat_ord(enc_data[-1])
         video_url_chars = []
 
         for idx, c in enumerate(enc_data):
             j = compat_ord(c)
+            if j == magic:
+                j -= 1
+            elif j == magic - 1:
+                j += 1
             if j >= 33 and j <= 126:
                 j = ((j + 14) % 94) + 33
             if idx == len(enc_data) - 1: