Closed romaincointepas closed 9 years ago
It works fine here, how are you getting the information? are you using your own server?
I'm on Appengine python. On your side, the 'url' field doesn't return a 403 ? Are you getting a 'player_url' field as well ?
The url can be played fine on Firefox, mpv and I have downlaoded it with curl. I also get the player_url
field, but I don't think that's a problem. I've looked in the logs and the signature extraction seems to be run.
Are you selecting a specific format or the url from the main dictionary?
Here is how I'm reproducing:
import sys
import webapp2
from google.appengine.api import urlfetch
import json
import youtube_dl
####################################################################
if not hasattr(sys.stderr, 'isatty'):
sys.stderr.isatty = lambda: False
class SimpleYDL(youtube_dl.YoutubeDL):
def __init__(self, *args, **kargs):
super(SimpleYDL, self).__init__(*args, **kargs)
self.add_default_info_extractors()
class Test(webapp2.RequestHandler):
def get(self):
video_id = 'm1ET6SEtwbc'
ydl = SimpleYDL()
info = ydl.extract_info(video_id, download=False)
best_format = info['formats'][-1]
stream_url = best_format['url']
result = urlfetch.fetch(stream_url)
response = {
'url': stream_url,
'status': result.status_code
}
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dumps(response))
####################################################################
app = webapp2.WSGIApplication([('/', Test)], debug=True)
I get a 403
with this video: m1ET6SEtwbc
, and a 200 for this one: YP2BZc70pmQ
(same thing with all formats).
I'm using __version__ = '2014.03.27.1'
of youtube_dl
Do you have any log produced by the app?, Have you tried setting the cachedir
param and monkey patching?
If you can't reproduce it with my code I will close the issue.
Closing due to lack of information.
This happens with some videos (like this one: https://www.youtube.com/watch?v=m1ET6SEtwbc)
I think it's never doing the
_extract_signature_function()
things (available in youtube extractor) when doingextract_info()
.