예제 #1
0
파일: JsonTest.cs 프로젝트: Xen0byte/xdm
        public void ProcessJson()
        {
            var res1 = YDLOutputParser.Parse(@"C:\Users\subhrad\Desktop\80a44682-5ea8-4193-bc52-34ee568ce9bb.json");

            Console.WriteLine(JsonConvert.SerializeObject(res1));

            //var res2 = YDLOutputParser.Parse(@"C:\Users\subhro\Desktop\ccc39b43-0fd1-464d-ba11-d608242dcdc2.json");
            //Console.WriteLine(JsonConvert.SerializeObject(res2));
        }
예제 #2
0
 private void ProcessVideo(string url, string?browser, Action <List <YDLVideoEntry>?> callback)
 {
     ydl = new YDLProcess
     {
         Uri         = new Uri(url),
         BrowserName = browser
     };
     new Thread(() =>
     {
         try
         {
             ydl.Start();
             callback.Invoke(YDLOutputParser.Parse(ydl.JsonOutputFile));
         }
         catch (Exception ex)
         {
             Log.Debug(ex, "Error while running youtube-dl");
             callback.Invoke(null);
         }
     }).Start();
 }