Python Forum

Full Version: Blob object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While scraping an webpage I found that the src of a video link is supplied as a blob object. Like this: src = blob:"www.xyz...."

Now how to deal with blob object in python?
The URL would be most helpful.
Also tag and parents
(Feb-10-2020, 05:38 PM)Larz60+ Wrote: [ -> ]The URL would be most helpful.
Also tag and parents
Quote:<video tabindex="-1" class="video-stream html5-main-video" controlslist="nodownload" style="width: 615px; height: 346px; left: 0px; top: 0px;" src="blob:https://www.youtube.com/f2e24726-595a-46d9-92af-9282412326b4"></video>

By the way I opened a random youtube page and this is the link https://www.youtube.com/watch?v=jH9Ln-LoneA
I was asking for the URL of the webpage you are scraping.
(Feb-11-2020, 02:56 AM)Larz60+ Wrote: [ -> ]I was asking for the URL of the webpage you are scraping.
Well let me explain what I was doing. I was making a YouTube downloader. So I picked up any random page. For our purposes we can use the url I posted above.
Downloading from YouTube is a snap with pytube: https://pypi.org/project/pytube/
(Feb-11-2020, 05:35 AM)Larz60+ Wrote: [ -> ]Downloading from YouTube is a snap with pytube: https://pypi.org/project/pytube/
Thank you. But I don't want to use any package. I want to learn the coding and hence I want to build it manually. Any guidance?
the only thing I can advise would be to download the source of pytube and examine how they wrote the package. That will help you formulate your own package. Github source: https://github.com/hbmartin/pytube3
(Feb-11-2020, 11:14 AM)Larz60+ Wrote: [ -> ]the only thing I can advise would be to download the source of pytube and examine how they wrote the package. That will help you formulate your own package. Github source: https://github.com/hbmartin/pytube3
Thank you. But can we deal with blob objects (src="blob:https://www.youtube.com/f2e24726-595a-46d9-92af-9282412326b4">) in python?

(Feb-11-2020, 11:14 AM)Larz60+ Wrote: [ -> ]the only thing I can advise would be to download the source of pytube and examine how they wrote the package. That will help you formulate your own package. Github source: https://github.com/hbmartin/pytube3

from pytube import YouTube

yt = YouTube(url='https://www.youtube.com/watch?v=jH9Ln-LoneA')

print(yt.title)
After running this I am getting this error:

KeyError: 'url_encoded_fmt_stream_map'