Skip to main content
Tweeted twitter.com/StackCodeReview/status/1575772464646332417
edited tags
Link
Peter Csala
  • 10.8k
  • 1
  • 16
  • 36
add tags
Link
deleted 40 characters in body; edited tags; edited title
Source Link
Peter Csala
  • 10.8k
  • 1
  • 16
  • 36

My C# code for grabbing Grabbing youtube thumbnails from urls

I made some C# code to grab youtube thumbnails from urls, I originally made this in python took some time converting it to C#. I am VERY new to C# and did this with minimal help.

Please Review!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {

            var HD = "maxresdefault.jpg";
            var SD = "hqdefualt.jpg";
            Console.WriteLine("Welcome to the C# version of YT thumbnail grabber!\nTo get started, go to any video and click 'copy url', then paste it into the program and we'll do the rest!\nTwo websites will open, one with a HD version of the thumbnail, and one with a SD version\nWARNING: A THUMBNAIL MAY ONLY LOAD IN SD OR HD. WHICHEVER IT WAS MADE IN\nInput URL now - ");
            var link = Console.ReadLine();
            var image = link.Split('/')[3];
            var website = "https://img.youtube.com/vi/" + image + "/";

            void openBrowser(string a, string b)
            {
                System.Diagnostics.Process.Start(website + a);
                System.Diagnostics.Process.Start(website + b);
            }

            openBrowser(HD, SD);
            

            Console.Read();
        }
    }
}

}

My C# code for grabbing youtube thumbnails from urls

I made some C# code to grab youtube thumbnails from urls, I originally made this in python took some time converting it to C#. I am VERY new to C# and did this with minimal help.

Please Review!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
internal class Program
{
    static void Main(string[] args)
    {

        var HD = "maxresdefault.jpg";
        var SD = "hqdefualt.jpg";
        Console.WriteLine("Welcome to the C# version of YT thumbnail grabber!\nTo get started, go to any video and click 'copy url', then paste it into the program and we'll do the rest!\nTwo websites will open, one with a HD version of the thumbnail, and one with a SD version\nWARNING: A THUMBNAIL MAY ONLY LOAD IN SD OR HD. WHICHEVER IT WAS MADE IN\nInput URL now - ");
        var link = Console.ReadLine();
        var image = link.Split('/')[3];
        var website = "https://img.youtube.com/vi/" + image + "/";

        void openBrowser(string a, string b)
        {
            System.Diagnostics.Process.Start(website + a);
            System.Diagnostics.Process.Start(website + b);
        }

        openBrowser(HD, SD);
        

        Console.Read();
    }
}

}

Grabbing youtube thumbnails from urls

I made some C# code to grab youtube thumbnails from urls, I originally made this in python took some time converting it to C#. I am VERY new to C# and did this with minimal help.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {

            var HD = "maxresdefault.jpg";
            var SD = "hqdefualt.jpg";
            Console.WriteLine("Welcome to the C# version of YT thumbnail grabber!\nTo get started, go to any video and click 'copy url', then paste it into the program and we'll do the rest!\nTwo websites will open, one with a HD version of the thumbnail, and one with a SD version\nWARNING: A THUMBNAIL MAY ONLY LOAD IN SD OR HD. WHICHEVER IT WAS MADE IN\nInput URL now - ");
            var link = Console.ReadLine();
            var image = link.Split('/')[3];
            var website = "https://img.youtube.com/vi/" + image + "/";

            void openBrowser(string a, string b)
            {
                System.Diagnostics.Process.Start(website + a);
                System.Diagnostics.Process.Start(website + b);
            }

            openBrowser(HD, SD);
            

            Console.Read();
        }
    }
}
Source Link
Loading