Jump to content

carlosmc

Members
  • Posts

    6
  • Joined

  • Last visited

carlosmc's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi I got my ip wrong too many times in a row and my ip was blocked 190.201.22.252
  2. this is the script #!/usr/bin/python import cgi form = cgi.FieldStorage() import re import httplib import urllib import subprocess import sys import os # IMPORTANT: This directory must exist, and the web user must have full access to it media_dir = "/public_html/media/" if ("query" not in form and "watch" not in form): print("Content-type: text/plain\n") print("No search query entered.") sys.exit(0) if ("watch" in form): watch = re.sub(r'[./]', '', str(form["watch"].value)) outfile = media_dir + watch + ".mp4" subprocess.call(["youtube-dl", "-f", "18", "-o", outfile, "https://www.youtube.com/watch?v=" + watch], stdout = open("/dev/null", "w")) print("Content-type: video/mp4") print("Content-Length: " + str(os.path.getsize(outfile)) + "\n") f = open(outfile) while (True): chunk = f.read(1048576) if (len(chunk) == 0): f.close() break sys.stdout.write(chunk) sys.exit(0) query = str(form["hola"].value) conn = httplib.HTTPSConnection("www.youtube.com") conn.request("GET", "/results?search_query=" + urllib.quote(query)) res = conn.getresponse() ytlines = res.read().split("\n") conn.close() names = [] urls = [] for i in ytlines: m = re.search('/watch\?v=[^"]*"[^>]*title="[^"]*"', i) if (m): if (re.search('ypc-badge', i)): continue m = i[m.start():m.end()] names.append(re.sub('/watch\?v=([^"]*)".*title="([^"]*)".*', r'\2', m)) urls.append(re.sub('/watch\?v=([^"]*)".*title="([^"]*)".*', r'\1', m)) print("Content-type: text/plain\n") for i,j in zip(names, urls): print("youtube.py?watch=" + j + "&videoname=/" + i)
  3. Source: https://github.com/rg3/youtube-dl/blob/master/README.md#readme Which version of python are you using? I'm using python 2.7
  4. the script allows that from the wii console, videos from youtube.com can be viewed through youtube-dl (the official support of youtube in this console already finished) is only for personal use
  5. I am new to heliohost. I am running a python script which needs module youtube-dl: https://youtube-dl.org can you please install python module youtube-dl I am trying to run a script which demand this. i am on Johnny server. Thanks and you guys are doing great job.
×
×
  • Create New...