Esempio n. 1
0
 /// <summary>
 /// Gets output file path depending on whether the postprocess operation is enabled or not
 /// </summary>
 /// <param name="grabber"></param>
 /// <returns></returns>
 public static string GetOutputPath(Grabber grabber)
 {
     if (grabber.config.postProcessEnabled)
     {
         return(grabber.config.postProcessOutputFilePath);
     }
     else
     {
         return(grabber.config.outputFilePath);
     }
 }
Esempio n. 2
0
        static void SingleGrabberExited(object sender, EventArgs e)
        {
            Grabber temp = null;

            lock (grabbersGroup2)
            {
                if (grabbersGroup2.Count > 0)
                {
                    temp = grabbersGroup2[0];
                    grabbersGroup2.Remove(temp);
                }
            }
            if (temp != null)
            {
                StartWegGrabInstance(temp);
            }
        }
Esempio n. 3
0
        static void DataReceived(object sender, DataReceivedEventArgs e, Grabber grabber)
        {
            if (!String.IsNullOrEmpty(e.Data))
            {
                //TODO check if channels are grouped by ini
                if (rootConfig.channels.Count == 1 || (Arguments.maxAsyncProcesses == 1 && Arguments.maxChannelsInGroup == 1))
                {
                    Console.WriteLine(e.Data);
                    return;
                }
                var name = grabber.id.ToUpper();
                var reg  = new Regex(@"xmltv_id=(.*?)\)");
                try { grabber.currentChannel = reg.Matches(e.Data)[0].Groups[1].Value; } catch { }
                if (e.Data.Contains("started") || e.Data.Contains("finished"))
                {
                    Console.WriteLine("Grabber {0} | {1}", name, e.Data.Replace(name, ""));
                }
                if (e.Data.Contains("xmltv_id") && !e.Data.Contains("Could find existing channel"))
                {
                    Console.WriteLine("Grabber {0} | starting {1}", name, e.Data.Replace("(   ", "").Replace("   ) " + name + " -- chan. (xmltv_id=", " ").Replace(") --", " "));
                }
                if (e.Data.ToLower().Contains("error"))
                {
                    Console.WriteLine("Grabber {0} | ERROR! {1} {2}", name, grabber.currentChannel, e.Data);
                }

                if (e.Data.Contains("no shows in indexpage"))
                {
                    Console.WriteLine("Grabber {0} | ERROR! no shows in indexpage for channel {1}", name, grabber.currentChannel);
                    failedChannelIds.Add(grabber.currentChannel);
                }
                if (e.Data.Contains("no index page data"))
                {
                    Console.WriteLine("Grabber {0} | ERROR! {1}", name, e.Data);
                    failedChannelIds.Add(grabber.currentChannel);
                }
                if (e.Data.Contains("unable to update channel"))
                {
                    Console.WriteLine("Grabber {0} | ERROR! {1} {2}", name, grabber.currentChannel, e.Data);
                }
            }
        }