Skip to content
/ xtractify Public

Simply fast yt-dlp api using Sanic.

Notifications You must be signed in to change notification settings

n-ce/xtractify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xtractify Reborn

  • Reborn with Sanic, with
    • 17.5x more requests per second
    • 15x lesser latency on average compared to bottle.py.
  • zero dependencies, well technically sanic & yt-dlp are still required.
from sanic import Sanic,text
from yt_dlp import YoutubeDL

app = Sanic('xtractify')

@app.get('/')
async def index(request):
    return text('/uid/itag')

@app.get('/<id>/<itag>')
async def main(request,id,itag):
    ydl = YoutubeDL({'format': itag}).extract_info('https://youtu.be/'+id, download=False)
    if ydl :
        return text(ydl['url'])

Thanks to render for hosting the web service.