
YouTube Without JavaScript - x3blah
POC<p>Tested on Linux<p>Requires tr, sed, grep, netcat, curl<p>List of itags https:&#x2F;&#x2F;gist.github.com&#x2F;sidneys&#x2F;7095afe4da4ae58694d128b1034e01e2<p>Works for <i>non-commercial videos</i><p>Will not work for commercial videos, e.g., popular music videos<p>Usage: Run the script then navigate to PAGE1<p><pre><code>   firefox .&#x2F;0.html

   #!&#x2F;bin&#x2F;sh 
   IP=10.0.0.1;
   PORT1=8000;
   PORT2=8001;
   WAIT=4;
   PAGE1=0.htm;
   PAGE2=1.htm;</code></pre>
#optional: for use with original nc, create an empty file $NETCATKEEPALIVE to keep script running continuously - Ctrl-C or remove file to stop script<p><pre><code>   NETCATKEEPALIVE=.ncka;
</code></pre>
printf &#x27;&lt;form method=post id=1 action=http:&#x2F;&#x2F;&#x27;$IP&#x27;:&#x27;$PORT1&#x27; enctype=text&#x2F;plain&gt;&lt;h3&gt;YouTube without JavaScript&lt;&#x2F;h3&gt;URL&lt;br&gt;&lt;textarea form=1 name=c cols=30 placeholder=https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=puJePACBoIo autofocus&gt;&lt;&#x2F;textarea&gt;&lt;br&gt;ITAG&amp;nbsp;&lt;input name=t type=text value=22 size=1&gt;&lt;br&gt;&lt;input type=submit&gt;&lt;&#x2F;form&gt;&#x27; &gt;$PAGE1;_s(){ sed &#x27;s&#x2F;^&#x2F;url=&#x2F;&#x27;|curl -sK- 2&gt;&#x2F;dev&#x2F;null;}; _y(){ b=$(exec sed  &#x27; s&#x2F;http:&#x2F;https:&#x2F;; s&#x2F;m.youtube&#x2F;www.youtube&#x2F;; s&#x2F;youtu.be.&#x2F;www.youtube.com\&#x2F;watch?v=&#x2F;; s&#x2F;hooktube.com&#x2F;youtube.com&#x2F;; s&#x2F;embed.&#x2F;watch?v=&#x2F;; s&#x2F;&amp;.<i>&#x2F;&#x2F;; #etc.; s&#x2F;?version.</i>&#x2F;&#x2F;; s&#x2F;;.<i>&#x2F;&#x2F;; &#x27;); c=${b##</i>=}; a=$(echo &quot;$b&quot;|_s|exec grep -o &quot;https[^\&quot;]<i>&quot;|exec sed -e &quot;&#x2F;itag=$1&#x2F;!d;s&#x2F;..u0026&#x2F;\&amp;&#x2F;g&quot; -e &quot;s,\\\,,g&quot;); test x$a != x&quot;&quot;|| a=$(echo &quot;$b&quot;|_s|exec grep -o &quot;https[^\&quot;]</i>videoplayback<i>[^\&quot;\\]</i>itag[^\&quot;\\]*&quot;|sed &quot;&#x2F;itag%3D$1&#x2F;!d;s&#x2F;%26&#x2F;\&amp;&#x2F;g;s&#x2F;%3D&#x2F;=&#x2F;g;s&#x2F;%3A&#x2F;:&#x2F;g;s&#x2F;%2F&#x2F;\&#x2F;&#x2F;g;s&#x2F;%3F&#x2F;?&#x2F;g;s&#x2F;%25&#x2F;%&#x2F;g&quot;); echo &quot;$a&quot;; }; printf &#x27;http&#x2F;1.0 302 ok\r\ncontent-Type: text&#x2F;html\r\nconnection: close\r\nlocation: &#x27; &gt;$PAGE2; printf &#x27;HTTP&#x2F;1.0 200 OK\r\nContent-Type: text&#x2F;html\r\nConnection: close\r\n\r\n&lt;meta http-equiv=refresh content=&quot;&#x27;$WAIT&#x27;;http:&#x2F;&#x2F;&#x27;$IP&#x27;:&#x27;$PORT2&#x27;&quot;&gt;wait &#x27;$WAIT&#x27;&#x27;|nc -q15 -lp $PORT1|sed &#x27;&#x2F;[ct]=&#x2F;!d;s&#x2F;[ct]=&#x2F;&#x2F;&#x27;|tr -d &#x27;\r&#x27;|tr &#x27;\n&#x27; &#x27;\040&#x27;|{ read URL ITAG;echo $URL|_y $ITAG &gt;&gt;$PAGE2;}; printf &#x27;\r\n\r\n&#x27; &gt;&gt;$PAGE2; nc -q15 -lp $PORT2 &lt; $PAGE2 &gt;&#x2F;dev&#x2F;null; test -f $NETCATKEEPALIVE||exit; $0
======
x3blah
Correction: firefox ./0.html should be firefox ./0.htm

