18

If you insist on using hooktube, just use youtube-dl and copy the URL it produces

Submitted by leftous in freeAsInFreedom (edited )

Download youtube-dl

Execute this command (replace URL with the video you want to watch):

youtube-dl **URL** -g -f 43

This produces the link that you can copy into your browser for direct streaming from google (which is what hooktube does), and you don't need to use an alt-right site.

EDIT: The -f 43 refers to the format.

You may want to use -f 22 for a better quality MP4 version. You can get the list of available format codes for particular video using --list-formats. This is the youtube-dl guide on formats https://github.com/rg3/youtube-dl/blob/master/README.md#format-selection

Static HTML/js edition - https://radtube.herokuapp.com/?v=K7ngGOlna0A

Comments

You must log in or register to comment.

2

subatomic0 wrote

Thanks for this, did not realize hooktube was an alt-right site.

2

Gabe wrote

Is the 43 at the end just an arbitrary buffer size?

2

senectus wrote

I never knew it was alt-right.. but tbh i only ever use it to watch colbert report videos... so yeah I'm ok with that :-P

2

imminent wrote (edited )

Thanks for that, though

This produces the link that you can copy into your browser for direct streaming from google (which is what hooktube does), and you don't need to use an alt-right site.

If you turn that into something static that can be loaded on github pages then you won't ever hear about hooktube from me, but as it stands you have to torify youtube-dl and hope that there won't be any leaks (torsocks sucks now since it is unmaintained).

(Also my goal was to screw hooktube while profiting off of it, but if there's an alternative then as I said time and time again I won't be using it then. Also there needs to be search and video api just like hooktube has for it to be an alternative)

6

leftous wrote

Alright I'm getting started on it, I'm making this just for you IMMINENT

Rough javascript edition: https://radtube.herokuapp.com/?v=K7ngGOlna0A

2

imminent wrote

Looks great for a start, just needs .... searches, images, related videos, comments, ... It's not easy though. By the way I will become an official supported of Radtube if you're serious about it

2

leftous wrote

Alright, if you're seriously not just a hooktube troll, I'll put some more work into it.

Right now, the code is essentially just a static html5 page that hits an instance of youtubedl api

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>test</title>
  </head>
  <body>
	<div id="video_area">
	</div>
	<p>
	<h3>Source url:</h3>
	<textarea id="source_url" rows="3">
	</textarea>
	</p>
	
  </body>
  <script type="text/javascript">
    var httpRequest = new XMLHttpRequest();
	httpRequest.onreadystatechange = function (data) {
	  if(httpRequest.readyState === 4) {
		if(httpRequest.status === 200) { 
		  var resp = JSON.parse(httpRequest.responseText);
		  var source_url = resp.info.url;
		  document.getElementById('source_url').value = source_url;
		  document.getElementById('video_area').innerHTML 
		  = '<video controls>'
	    +'<source id="mp4" src="'+source_url+'">'
		+'</video> ';
		} else {
		  console.log(httpRequest.statusText);
		} 
	  }
	}
	var params = new URLSearchParams(location.search.slice(1));
	var yt_vid = "https://www.youtube.com/watch?v="+params.get('v').trim();
	var url = "https://youtdl.herokuapp.com/api/info?url="+yt_vid;
	httpRequest.open('GET', url);
	httpRequest.send();
	
</script>
</html>
2

imminent wrote

Mate, there's nothing stopping you from copying hooktube's whole html and css source code and make some necessary modifications to it to adapt it to the youtubedl server instance view-source:https://hooktube.com/ and view-source:https://hooktube.com/watch?v=NotReallyaCorrectValue

2

leftous wrote

I can certainly do that, but I'd have to take a closer look to make sure it's safe

2

imminent wrote (edited )

Here's something that may be better (for the time being),

  • Download all hooktube public source
  • Change all instances of https://hooktube.com/api to https://web.archive.org/save/_embed/https://hooktube.com/api
  • Delete the entry for popular videos on the front page
  • Edit marketing, delete fascist stuff
  • Harden it by adding security headers (no referrer policy, ...) and hashes checks for 3rd party scripts (change cloudflare's cdnjs with jsdeliver which is faster - but the best is to have the Decentraleyes addon installed)
  • Host it on github pages or gitlab pages,

That way while it still invokes the hooktube API there's the internet archive that acts as a proxy which is better than the current situation.

What do you think?

1

leftous wrote (edited )

It could be an issue with the way the code is licensed and I have no idea what is going on with their servers. It might be preferable to get the info myself from youtubes API to keep it free and safe.

2

imminent wrote

It could be an issue with the way the code is licensed and I have no idea what is going on with their servers. It might be preferable to get the info myself from youtubes API to keep it free and safe.

I only meant that as a temporary solution, you could then change the video API that is used to yours when it gets more advanced.