Messages - mediaguycouk [ switch to compact view ]

Pages: [1] 2 3 4 5 6 ... 48next
1
Official Announcements / Re: DonationCoder 2018 Fundraiser
« on: May 14, 2018, 11:10 AM »
Tomorrow we will talk a little about how the money raised will be used.
Where's that post?

2
Official Announcements / Re: DonationCoder 2018 Fundraiser
« on: April 24, 2018, 08:32 AM »
I shall presume it doesn't contribute to your thermometer goal, but thank you for setting up the Patreon.

3
Really... 2011? I need to sort out my bookmarks, they read

Reddit
Giant Bomb
Twitter
Donation coder recent posts

Anyway, I blame Reddit for the lack of posts here! Also I actually managed to work out how autohotkey and visual studio works so I didn't have to pester other people to make my applications.

I worked at the University of Southampton when I joined and I'm still there. I look after online exams and lecture capture. My ExamStart system (remembering that I really couldn't program anything when I joined this site) is one of the only specialist University exam portals in existence (because no-one else would have use for it: https://www.youtube.com/watch?v=Os46Zcuk_GU)

4
Sorry if I get a little Captain Obvious here, but are you sure the request packet is being replicated exactly?
It's the same as the WireShark capture, but past that I can't be 100%.

I've certainly given up on this, so don't spend any more time on it. Once the announce works I've got to query the box for the channels all while programming on a subnet that doesn't actually have the boxes on it.

This project is where an attitude of 'fail quickly and adapt' is working well. The C# application to use the Wireshark data works well enough for how little it would be used.

Thanks all

Graham

5
Thanks Jazper,
You code confirms what I've previously found. It seems quite easy and reliable to get the router you are connected to to respond to these types of broadcasts but the more unreliable and inconsistent IPTV systems seem to lock up the .Receive commands.

In the end I've been using Wireshark and monitoring the responses of a propriety IPTV multicast program. I then export the filtered Wireshark output into a C# application to get all the channels.

Code: C# [Select]
  1. // Please excuse the fact that I found out it was called 'Wireshark' about half way through and then
  2. // couldn't be bothered fixing the function names
  3. private void btnOpenWireShackFile_Click(object sender, EventArgs e)
  4.         {
  5.             MessageBox.Show("Remember to select the Wireshark \"K12 Text File\" that you have saved with " +
  6.                 "the filter 'sap.flags' (no apostrophes) and save \"Packet Range: Displayed\" and \"All packets\"",
  7.                 "Instructions", MessageBoxButtons.OK, MessageBoxIcon.Information);
  8.  
  9.             btnSave.Enabled = false;
  10.  
  11.             openWireshackTxtFile.Title = "Choose wireshark txt file";
  12.             openWireshackTxtFile.Filter = "TXT Files|*.txt";
  13.  
  14.             if (openWireshackTxtFile.ShowDialog(this) == DialogResult.OK)
  15.             {
  16.                 strWireSharkFileLocation = openWireshackTxtFile.FileName;
  17.  
  18.                 replaceBigTextBox("");
  19.                 replaceM3UTextBox("");
  20.  
  21.                 Thread threadReadHex = new Thread(readHexAndOutputASCII);
  22.                 threadReadHex.IsBackground = true;
  23.                 threadReadHex.Start();
  24.             }
  25.         }
  26.  
  27.         private void readHexAndOutputASCII()
  28.         {
  29.             if (strWireSharkFileLocation == "VOID")
  30.             {
  31.                 return;
  32.             }
  33.            
  34.             try
  35.             {
  36.                 strWireSharkFile = File.ReadAllLines(strWireSharkFileLocation);
  37.             }
  38.             catch
  39.             {
  40.                 MessageBox.Show("Failed to open Wireshack file", "Fatal error",
  41.                     MessageBoxButtons.OK, MessageBoxIcon.Error);
  42.                 return;
  43.             }
  44.  
  45.             replaceM3UTextBox("#EXTM3U\r\n");
  46.  
  47.             int i = 1;
  48.             int j = 0;
  49.  
  50.             foreach (string line in strWireSharkFile)
  51.             {
  52.                 if (line.Length > 2 && line.Substring(0, 2) == "|0")
  53.                 {
  54.                     string[] characters = line.Split('|');
  55.                     string completeLine = "";
  56.  
  57.                     foreach (string hex in characters)
  58.                     {
  59.                        
  60.                         if (hex.Length == 2)
  61.                         {
  62.                             try
  63.                             {
  64.                                 int n = Convert.ToInt32(hex, 16);
  65.                                 if (n >= 32 && n < 255)
  66.                                 {
  67.                                     char c = (char)n;
  68.                                     completeLine += c.ToString();
  69.                                 }
  70.                                 else if (n == 10)
  71.                                 {
  72.                                     completeLine += "|";
  73.                                 }
  74.                             }
  75.                             catch
  76.                             {
  77.                                 // Do we need to do anything here?
  78.                             }
  79.                         }
  80.                     }
  81.  
  82.                     addToBigTextBox(completeLine.Replace("|", "\r\n") + "\r\r\n");
  83.  
  84.                     string[] partLine = completeLine.Split('|');
  85.  
  86.                     foreach (string data in partLine)
  87.                     {
  88.  
  89.                         if (data.Length > 3 && data.Substring(0, 2) == "s=")
  90.                         {
  91.                             string channelName = data.Substring(2, data.Length - 2);
  92.                             addToM3UTextBox("#EXTINF:" + i + "," + channelName + "\r\n");
  93.                         }
  94.  
  95.                         if (data.Length > 3 && data.Substring(0, 2) == "c=")
  96.                         {
  97.                             string nospacedata = data.Replace(" ", "");
  98.                             string[] splitip = nospacedata.Split('/');
  99.                             string ip = splitip[0].Substring(7, splitip[0].Length - 7);
  100.                             addToM3UTextBox("udp://" + ip + ":5000" + "\r\n");
  101.                         }
  102.  
  103.                        
  104.                     }
  105.                     decimal deProgressBar = (((decimal)j + 1) / (decimal)strWireSharkFile.Length) * 100;
  106.                     intProgressBar = (int)Math.Ceiling(deProgressBar);
  107.                     changeProgressBar();
  108.                     i++;
  109.                 }
  110.                 j++;
  111.             }
  112.             intProgressBar = 100;
  113.             changeProgressBar();
  114.         }

Pages: [1] 2 3 4 5 6 ... 48next
Go to full version