question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some formats often can't be downloaded (example itag 136)

See original GitHub issue

I started using YouTubeExplode a few days ago (I think I have the newest version). I were using youtube-dl before, but I switched because your code is more readable (mainly because I prefer C# over python).

From what I can tell, you are getting the Download links of videos the same way youtube-dl gets them. But youtube-dl won’t try to download the videos from their URLs if their URLs don’t work. There are video formats that (I think always) get uploaded as DASH-segments (many small parts that have to be combined to get the full video). The 2 formats I have most experience with are 136 (DASH mp4 720p video only) and 137 (DASH mp4 1080p video only).

These formats sometimes have a working download URL and sometimes have not. If you want to consistently download these formats, you need to download the DASH-segments and combine them locally (youtube-dl does that). If I try to download the videoformat 136 of this video: https://www.youtube.com/watch?v=Lhw5xo67tdE with youtube-dl, it works. With YoutubeExplode, it does not.

I hope you can implement such a feature as well.

Here is code I used to test YoutubeExplodes behavior towards DASH-format 136 compared to a the normal format 22.

using System;
using YoutubeExplode;
using YoutubeExplode.Models.MediaStreams;

namespace ConsoleApp1{
    class Program{

        static void Main(string[] args){
            Program program = new Program();
            program.testFortmats();
            Console.ReadLine();
        }

        public async void testFortmats() {
            var videoId = "Lhw5xo67tdE";
            var client = new YoutubeClient();

            //getting information about all available formats (and more)
            var streamInfoSet = await client.GetVideoMediaStreamInfosAsync(videoId);
            var infos = streamInfoSet.GetAll();

            //walk through each individual format available
            foreach (MediaStreamInfo info in infos){
                //print the DownloadURL of format 22 (if available)
                if (info.Itag == 22){
                    Console.WriteLine("Download URL for format 22:");
                    Console.WriteLine(info.Url + "\n");
                }
                //print the DownloadURL of DASH-format 136 (if available)
                if (info.Itag == 136){
                    Console.WriteLine("Download URL for format 136:");
                    /*this URL sometimes works, sometimes does not. copy it into 
                    **your browser and test it. If it does not work in my browser, I cannot 
                    **download it either (I guess this behavior should be similar for you)*/
                    Console.WriteLine(info.Url + "\n"); 
                }
            }
        }
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Tyrrrzcommented, Oct 9, 2018

Okay, I see. So, first of all, I need to fix the filtering logic so that partial streams are not shown, because currently, YTE doesn’t know how to download them. Then, I suppose, a separate issue needs to be created to add support for downloading of partial streams.

1reaction
Tyrrrzcommented, Oct 9, 2018

Hm. I will have to keep trying then. I know sometimes I was able to get different itag sets one day apart.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to fix the error while downloading video - youtube dl
Try downloading the video using the link which displays on the address bar of your web-browser... This post may help to get to...
Read more >
command line - How to select video quality from youtube-dl?
Usually it will only download 720p as its max even if you can see 1080p on youtube.com. Run with -F to see available...
Read more >
yt-dlp
yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc. The main focus of this project is adding new features and patches...
Read more >
ytdl-core - npm
Can be an itag value, a list of itag values, or highest / lowest ... format - Primarily used to download specific video...
Read more >
pytube3 Documentation
This guide will walk you through the basic usage of pytube. Let's get started with some examples. 3.2.1 Downloading a Video. Downloading a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found