Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Use youtube-dl as a library #54

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move imports
  • Loading branch information
redapple committed Nov 18, 2015
commit 82a5d88a17b2cd468c669e73560fd6ee763ba0f3
8 changes: 3 additions & 5 deletions steve/scrapers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from datetime import datetime

import youtube_dl

from steve.util import is_youtube


Expand Down Expand Up @@ -48,11 +50,7 @@ def scrape(self, url):
if not is_youtube(url):
return

import youtube_dl

ydl = youtube_dl.YoutubeDL()

with ydl:
with youtube_dl.YoutubeDL() as ydl:
result = ydl.extract_info(url, download=False)

if 'entries' in result:
Expand Down