Gopher And YouTube

Gopher is an awesome protocol designed for distributing, searching, and retrieving files and documents over the internet. Gopher is purposefully oriented towards a menu based design and is an alternative to the World Wide Web. Some may consider Gopher part of the ‘dark web’ or the internet that is rarely or never crawled by search engines. Others just think Gopher is out of date and deprecated. I think they are wrong.

Gopher is amazing but one of the major complaints that people have is the lack of modern amenities provided by the likes of the World Wide Web proper. However, the folks at shroom party have devised a method to integrate YouTube with Gopher and even offer rudimentary searching. This is amazing!



How Do They Do It?

The below code accomplishes the YouTube to Gopher translation. They are able to kick off python scripts from their Gopher server and are able to create a gopher site they serve on the fly from an API connection they have with YouTube. Check out their git!


1 #!/usr/bin/env python3
2 import sys
3 import yapi
5 def main(kw):
6 	list = []
8 	# query from api
9 	with open('/home/gopher/.ytapikey', 'r') as keyfile:
10 		key =
11 	api = yapi.YoutubeAPI(key)
12 	results = api.general_search(kw, max_results=10)
13 	for r in results.items:
14 		if == 'youtube#video':
15 			res = {"title": r.snippet.title, "id":, "channel": r.snippet.channelTitle, "url": f"{}"}
16 			list.append(res)
18 	# print
19 	print('tresults for: '+kw)
20 	print()
21 	for r in list:
22 		print(f"[i|{r['channel']} {r['title']}||server|port]")
23 		print(f"[h|{r['url']}|URL:{r['url']}|server|port]")
24 		print(f"[9|download|/yt/dl.cgi?{r['id']}|server|port]")
25 		print()
27 main(sys.argv[1])


1 #!/bin/bash
2 youtube-dl --cache-dir /tmp/ytcache -q "$2" -o - 2>/dev/null