<div dir="ltr">2013/5/3 chintan prajapati <span dir="ltr"><<a href="mailto:chintanbprajapati@gmail.com" target="_blank">chintanbprajapati@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:12px;font-family:Consolas,'Liberation Mono',Courier,monospace;color:rgb(51,51,51);line-height:18px"><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">


<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Global variables</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">dlg</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">dialog_is_opened</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">dialog_is_hidden</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">update_title_needed</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">website</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">main_text_input</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">search_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">load_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">subtitles_list</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">type_text_input</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Extension description</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">descriptor</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">{</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">title</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">AutoSubtitles"</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">version</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">1"</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">author</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">jean caffou"</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">url</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">'</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><a href="http://www.kafol.net" target="_blank">http://www.kafol.net</a>'</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">description</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">shortdesc</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">capabilities</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">input-listener"</span> <span style="margin:0px;padding:0px;border:0px">;</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">meta-listener"</span> <span style="margin:0px;padding:0px;border:0px">}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">}</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Get clean title from filename</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">get_title</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">str</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">item</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">item</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">item</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">item</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">metas</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">item</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">metas</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">metas</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">title"</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">metas</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">title"</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">filename</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">item</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">name</span><span style="margin:0px;padding:0px;border:0px">(),</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">^(.+)%.%w+$"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%1"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">trim</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">filename</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">item</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">name</span><span style="margin:0px;padding:0px;border:0px">())</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Remove leading and trailing spaces</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">trim</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">str</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">str</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">str</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">^%s*(.-)%s*$"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%1"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Function triggered when the extension is activated</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">activate</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">new_dialog</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Download subtitles"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">show_dialog_download</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Function triggered when the extension is deactivated</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">deactivate</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">dialog_is_opened</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">close</span><span style="margin:0px;padding:0px;border:0px">()</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px">reset_variables</span><span style="margin:0px;padding:0px;border:0px">()</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px">dlg</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">


<span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- self explanatory</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">reset_variables</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">update_title_needed</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">website</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">main_text_input</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">search_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">load_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">subtitles_list</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">type_text_input</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Function triggered when the dialog is closed</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">close</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Current input changed</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">input_changed</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Input is changed"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">update_title</span><span style="margin:0px;padding:0px;border:0px">()</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">click_search</span><span style="margin:0px;padding:0px;border:0px">()</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Update title in search dialog</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">update_title</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">dialog_is_hidden</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">update_title_needed</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">main_text_input</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">get_title</span><span style="margin:0px;padding:0px;border:0px">())</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">show_dialog_download</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- column, row, colspan, rowspan</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_label</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><right><b>Database: </b></right>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">website</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_dropdown</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_label</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><right><b>Language: </b></right>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_dropdown</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_label</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><right><b>Search: </b></right>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">main_text_input</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_text_input</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">search_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_button</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Search"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">click_search</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">3</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">--dlg:add_button("Hide", hide_dialog, 4, 3, 1, 1)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">ws</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">ipairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">websites</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">website</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_value</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">ws</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">title</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">ws</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">ipairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">languages</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_value</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">ws</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">title</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">update_title_needed</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">update_title</span><span style="margin:0px;padding:0px;border:0px">()</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">click_search</span><span style="margin:0px;padding:0px;border:0px">()</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">new_dialog</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">title</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">dlg</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">dlg</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dialog</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">title</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">hide_dialog</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dialog_is_hidden</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">hide</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">click_search</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">search_term</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">main_text_input</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">search_term</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">old_button_name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Wait..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">subtitles_list</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">subtitles_list</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">clear</span><span style="margin:0px;padding:0px;border:0px">()</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">idx</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">website</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_value</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">idx2</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_value</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">idx</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold"><</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">idx2</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold"><</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">err</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Invalid index in dropdown"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">ws</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">websites</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">lang</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">languages</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">idx2</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">url</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">ws</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">urlfunc</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">search_term</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">lang</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">tag</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- <a href="http://vlc.msg.info" target="_blank">vlc.msg.info</a>("Url: '" .. url .. "'")</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">stream</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">stream</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">err</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">The site of subtitles isn't reachable"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">reading</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">blah"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">xmlpage</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">while</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">reading</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">and</span> <span style="margin:0px;padding:0px;border:0px">reading</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">reading</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">read</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">65653</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">reading</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">xmlpage</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">xmlpage</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px">reading</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">       <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">xmlpage</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">ws</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">parsefunc</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmlpage</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">subtitles_list</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">subtitles_list</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_list</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">4</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">4</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">load_button</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_button</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Load selected subtitles"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">click_load_from_search_button</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">5</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">4</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">subtitles_result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">url</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">-1"</span> <span style="margin:0px;padding:0px;border:0px">}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">subtitles_list</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_value</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Nothing found"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">res</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">ipairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">res</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">lang</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">tag</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">all"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">lang</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">tag</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px">res</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">subtitles_list</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">add_value</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">["</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">res</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">] "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">res</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">name</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">idx</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px">search_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">load_first_result</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">load_unknown_subtitles</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Loading "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> subtitle: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">add_subtitle</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">load_subtitles_in_the_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">dataBuffer</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">buffer_length</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dataBuffer</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">len</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">files_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">0</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">subtitles_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">0</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">endIdx</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">srturl</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">extension</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Find subtitles</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">while</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">endIdx</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold"><</span> <span style="margin:0px;padding:0px;border:0px">buffer_length</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">_</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">endIdx</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">srturl</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dataBuffer</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><location>([^<]+)%.(%a%a%a?)</location>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">endIdx</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">srturl</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">break</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">          <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">--vlc.msg.dbg("File found in the archive: " .. srturl .. extension)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">files_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">files_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">+</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">srturl</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">srturl</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">^(%a%a%a)://"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%1://http://"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">          <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">ass"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">ssa"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">srt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">smi"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">sub"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">rt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">txt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">mpl"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">subtitles_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">subtitles_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">+</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Loading "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> subtitle: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">srturl</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">add_subtitle</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">srturl</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">."</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">extension</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">       <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">info</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Files found in the compressed file: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">files_found_in_the_compressed_file</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">info</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Subtitles found in the compressed file: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">subtitles_found_in_the_compressed_file</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">subtitles_found_in_the_compressed_file</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">></span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">0</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">warn</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">No subtitles found in the compressed file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">parse_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">url</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">-1"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Dummy result"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">stream</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">stream</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">err</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">The site of subtitles isn't reachable"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">addfilter</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">zip,stream_filter_rar"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">data</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">read</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">2048</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">data</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">data</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><?xml version"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">info</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Type: RAR or unknown file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">load_unknown_subtitles</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">info</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Type: ZIP file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">dataBuffer</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">while</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">data</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">and</span> <span style="margin:0px;padding:0px;border:0px">data</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Buffering..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">dataBuffer</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">dataBuffer</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">data</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">data</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">stream</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">read</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">8192</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px">load_subtitles_in_the_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">dataBuffer</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">--vlc.msg.dbg("Subtitle data: "..dataBuffer)</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">click_load_from_search_button</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Clicked load button from </span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Download subtitles</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> dialog"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">is_playing</span><span style="margin:0px;padding:0px;border:0px">())</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">warn</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">You cannot load subtitles if you aren't playing any file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">old_button_name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Wait..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">selection</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">subtitles_list</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_selection</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">name</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">pairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">selection</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Selected the item "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> with the name: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">URL: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">          <span style="margin:0px;padding:0px;border:0px">parse_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">index</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- ZIP, RAR or unknown file</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">load_first_result</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Loading first result"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">is_playing</span><span style="margin:0px;padding:0px;border:0px">())</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">warn</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">You cannot load subtitles if you aren't playing any file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">old_button_name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Wait..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">parse_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">url</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">subtitles_result</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">language</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">click_load_from_url_button</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Clicked load button in </span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Load subtitles from url...</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> dialog"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">is_playing</span><span style="margin:0px;padding:0px;border:0px">())</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">warn</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">You cannot load subtitles if you aren't playing any file"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">old_button_name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Wait..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">type_text_input</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">url_to_load</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">main_text_input</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">get_text</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url_to_load</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">false</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">URL: "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">_</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">ext_pos</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%.(%a%a%a?)"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">4</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">ext_pos</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">len</span><span style="margin:0px;padding:0px;border:0px">())</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">type_text_input</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">extension</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">ass"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">ssa"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">srt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">smi"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">sub"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">rt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">txt"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">or</span> <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">mpl"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">input</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">add_subtitle</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">parse_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">info</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Waiting 5 seconds before retry..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">result</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">parse_archive</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">url_to_load</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">load_button</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">set_text</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">old_button_name</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">dlg</span><span style="margin:0px;padding:0px;border:0px">:</span><span style="margin:0px;padding:0px;border:0px">update</span><span style="margin:0px;padding:0px;border:0px">()</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">result</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- XML Parsing</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">parseargs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">arg</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">(%w+)=([</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">'])(.-)%2"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">w</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">_</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">a</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">arg</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">w</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">a</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span><span style="margin:0px;padding:0px;border:0px">)</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">arg</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">collect</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">stack</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">top</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">top</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">ni</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">c</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">empty</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">j</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">while</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">true</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">ni</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">j</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">c</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">empty</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><(%/?)([%w:]+)(.-)(%/?)>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px">ni</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">break</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">text</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.sub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">ni</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">text</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">^%s*$"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">top</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">text</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">empty</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">/"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- empty element tag</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">top</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">{</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span><span style="margin:0px;padding:0px;border:0px">parseargs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px">),</span> <span style="margin:0px;padding:0px;border:0px">empty</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">})</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">c</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- start tag</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">top</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span><span style="margin:0px;padding:0px;border:0px">parseargs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xarg</span><span style="margin:0px;padding:0px;border:0px">)}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">top</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- new level</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- end tag</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">toclose</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.remove</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- remove top</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">top</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">#</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">#</span><span style="margin:0px;padding:0px;border:0px">stack</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold"><</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">error</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">nothing to close with "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">toclose</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">error</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">trying to close "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">toclose</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> with "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                        <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">top</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">toclose</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px">i</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">j</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">+</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">text</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.sub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">s</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">not</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.find</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">text</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">^%s*$"</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">table.insert</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">#</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">],</span> <span style="margin:0px;padding:0px;border:0px">text</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">#</span><span style="margin:0px;padding:0px;border:0px">stack</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">></span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">error</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">unclosed "</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">n</span><span style="margin:0px;padding:0px;border:0px">].</span><span style="margin:0px;padding:0px;border:0px">label</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">stack</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">urlOpenSub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">search_term</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">lang</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- base = "<a href="http://api.opensubtitles.org/en/search/" target="_blank">http://api.opensubtitles.org/en/search/</a>"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">search_term</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">search_term</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%%"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%%37"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">search_term</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">search_term</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> "</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%%20"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><a href="http://kafol.net/code/subtitles/search.php?s=" target="_blank">http://kafol.net/code/subtitles/search.php?s=</a>"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px">search_term</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">&l="</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px">lang</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- return base .. "moviename-" .. search_term .. "/simplexml"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- <a href="http://api.opensubtitles.org/en/search/moviename-" target="_blank">http://api.opensubtitles.org/en/search/moviename-</a> .. search_term .. /simplexml</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">function</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">parseOpenSub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmltext</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Parsing XML data..."</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">xmltext</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmltext</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><%?xml version=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">1%.0</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"> encoding=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">utf-8</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">\"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">%?>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">xmldata</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">collect</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmltext</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">a</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">b</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">pairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmldata</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">type</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">table"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">search"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px">xmldata</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">b</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">break</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">               <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">xmldata</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Subtitles information data</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">subname</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">sub_movie</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">suburl</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">sublang</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">sub_language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">subformat</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">subfilenum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">subnum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">local</span> <span style="margin:0px;padding:0px;border:0px">baseurl</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- Let's browse iteratively the 'xmldata' tree</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- OK, the variables' names aren't explicit enough, but just remember a couple</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- a,b contains the index (a) and the data (b) of the table, which might also be a table</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">a</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">b</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">pairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">xmldata</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">type</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">table"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">results"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">c</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">d</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">pairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">type</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">d</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">table"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">d</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">subtitle"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">e</span><span style="margin:0px;padding:0px;border:0px">,</span><span style="margin:0px;padding:0px;border:0px">f</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">in</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">pairs</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">d</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">type</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">table"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">releasename"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">subname</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">subname</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">movie"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">sub_movie</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">sub_movie</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">download"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">suburl</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">suburl</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">iso639"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span>  <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- two letter language code</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">sublang</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">sublang</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">language"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">sub_language</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">sub_language</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">format"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">~=</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span> <span style="margin:0px;padding:0px;border:0px">subformat</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">f</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px">subformat</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">subnum</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                                                                <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                       <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                                    <span style="margin:0px;padding:0px;border:0px">subnum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">subnum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">+</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                                            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                                        <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                               <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">elseif</span> <span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">label</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">base"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                            <span style="margin:0px;padding:0px;border:0px">baseurl</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">b</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

                <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">       <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">subnum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold"><=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">nil</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">ret</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">  <span style="margin:0px;padding:0px;border:0px;font-weight:bold">for</span> <span style="margin:0px;padding:0px;border:0px">i</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">,(</span><span style="margin:0px;padding:0px;border:0px">subnum</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">-</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">1</span><span style="margin:0px;padding:0px;border:0px">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">do</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">fullURL</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">suburl</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- baseurl .. "/" .. suburl[i]</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">realName</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span> <span style="margin:0px;padding:0px;border:0px">subname</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">],</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><..CDATA."</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">realName</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span> <span style="margin:0px;padding:0px;border:0px">realName</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">..>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px">realName</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">then</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">realName</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span> <span style="margin:0px;padding:0px;border:0px">sub_movie</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">],</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)"><..CDATA."</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                    <span style="margin:0px;padding:0px;border:0px">realName</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(0,134,179)">string.gsub</span><span style="margin:0px;padding:0px;border:0px">(</span> <span style="margin:0px;padding:0px;border:0px">realName</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">..>"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span> <span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">              <span style="margin:0px;padding:0px;border:0px">ret</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">]</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">name</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">realName</span><span style="margin:0px;padding:0px;border:0px">,</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                       <span style="margin:0px;padding:0px;border:0px">url</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">fullURL</span><span style="margin:0px;padding:0px;border:0px">,</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                       <span style="margin:0px;padding:0px;border:0px">language</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">sublang</span><span style="margin:0px;padding:0px;border:0px">[</span><span style="margin:0px;padding:0px;border:0px">i</span><span style="margin:0px;padding:0px;border:0px">],</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">                       <span style="margin:0px;padding:0px;border:0px">extension</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">.zip"</span> </div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">}</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">              <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Found subtitle "</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px">i</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">..</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">: "</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">realName</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">            <span style="margin:0px;padding:0px;border:0px">vlc</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">msg</span><span style="margin:0px;padding:0px;border:0px">.</span><span style="margin:0px;padding:0px;border:0px">dbg</span><span style="margin:0px;padding:0px;border:0px">(</span><span style="margin:0px;padding:0px;border:0px">fullURL</span><span style="margin:0px;padding:0px;border:0px">)</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span> <span style="margin:0px;padding:0px;border:0px">ret</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold">end</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">

<br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- These tables must be after all function definitions</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">websites</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">title</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Kafol.net"</span><span style="margin:0px;padding:0px;border:0px">,</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">urlfunc</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">urlOpenSub</span><span style="margin:0px;padding:0px;border:0px">,</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">      <span style="margin:0px;padding:0px;border:0px">parsefunc</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">parseOpenSub</span> <span style="margin:0px;padding:0px;border:0px">}</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">--[[;</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">   { title = "Fake (OS)",</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">     urlfunc = url2,</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px">


<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">         parsefunc = parse2 }]]</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">}</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">languages</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">{</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">title</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">English"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">tag</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">en"</span> <span style="margin:0px;padding:0px;border:0px">},</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">-- { title = "All", tag = "all" },</span></div>

<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">title</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">Slovenian"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">tag</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">sl"</span> <span style="margin:0px;padding:0px;border:0px">},</span></div>


<div style="margin:0px;padding:0px 0px 0px 10px;border:0px">    <span style="margin:0px;padding:0px;border:0px">{</span> <span style="margin:0px;padding:0px;border:0px">title</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">French"</span><span style="margin:0px;padding:0px;border:0px">,</span> <span style="margin:0px;padding:0px;border:0px">tag</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">fr"</span> <span style="margin:0px;padding:0px;border:0px">}</span></div>


</pre></div>
<br>_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
<br></blockquote></div><br></div><div class="gmail_extra" style>Please, don't post patches like that. If you do that, the Great Old Ones will wake up...</div><div class="gmail_extra" style><a href="http://wiki.videolan.org/Sending_Patch">http://wiki.videolan.org/Sending_Patch</a><br>
</div><div class="gmail_extra"><br></div></div>