python - How to retrieve a Youtube page without starting to stream the video? -
i'm not sure if tries stream video @ all, takes few seconds longer normal parse youtube page.
i'm looking parse random youtube video page see if has been removed or not, , i'm looking create sure video gets loaded. i've got next code works, takes while finish (i'm assuming video starts load slows down, haven't tested confirm though)
import requests, bs4 url = 'https://www.youtube.com/watch?v=xyz' parameters = {'magic_var' : 'no_load'} r = requests.get(url, params=parameters) soup = bs4.beautifulsoup(r.content) my question whether or not there's sort of parameter can set create sure video doesn't start loading on page request.
your browser stream video on separate request, after loaded page (and flash player referenced page). video not part of page info itself. neither styles, scripts, , images; references encoded in html page browser interpret.
just requesting page in , of not start video beingness streamed, no.
in other words, requests.get() load basic html markup browser loads. unless interpret html markup , start loading resources referenced in page, not automatically start loading else.
python youtube
No comments:
Post a Comment