Skip to content

Commit 22d16eb

Browse files
hagaygohagaygo
authored andcommitted
nuget updates + useragent changes
1 parent 7225bde commit 22d16eb

File tree

15 files changed

+47
-26
lines changed

15 files changed

+47
-26
lines changed

Config.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<EndDate>1</EndDate>
6161
</Parameters>
6262
</Grabber>-->
63-
<Grabber path="CyfrowyPolsat.pl.dll" channelPrefix="CyfrowyPolsat_">
63+
<!--<Grabber path="CyfrowyPolsat.pl.dll" channelPrefix="CyfrowyPolsat_">
6464
<Parameters>
6565
<Channels>
6666
<Channel>polsat-sport-1</Channel>
@@ -69,7 +69,7 @@
6969
<Channel>polsat-sport-premium-2</Channel>
7070
</Channels>
7171
</Parameters>
72-
</Grabber>
72+
</Grabber>-->
7373
<!--<Grabber path="sky.it.dll" channelPrefix="sky.it_">
7474
<Parameters>
7575
<Channels>
@@ -189,17 +189,16 @@
189189
</Channels>
190190
</Parameters>
191191
</Grabber>-->
192-
<!--<Grabber path="livesoccertv.com.dll" channelPrefix="livesoccertv.com_">
192+
<Grabber path="livesoccertv.com.dll" channelPrefix="livesoccertv.com_">
193193
<Parameters>
194194
<Channels>
195-
<Channel>match-tv-football-1-russia</Channel>
196195
<Channel>match-tv-football-2-russia</Channel>
196+
<Channel>nova-sport-czech-republic</Channel>
197+
<Channel>match-tv-football-1-russia</Channel>
197198
<Channel>match-tv-football-3-russia</Channel>
198-
<Channel>dazn1-germany</Channel>
199-
<Channel>dazn2-germany</Channel>
200199
</Channels>
201200
</Parameters>
202-
</Grabber>-->
201+
</Grabber>
203202
</Grabbers>
204203
</Config>
205204

Grabbers/Sky.it/Sky.it.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Folder Include="Properties\" />
1010
</ItemGroup>
1111
<ItemGroup>
12-
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
12+
<PackageReference Include="TimeZoneConverter" Version="7.0.0" />
1313
</ItemGroup>
1414
<ItemGroup>
1515
<ProjectReference Include="..\..\XmlTvGenerator.Core\XmlTvGenerator.Core.csproj" />

Grabbers/entertainment.ie/entertainment.ie.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="HtmlAgilityPack" Version="1.11.63" />
8+
<PackageReference Include="HtmlAgilityPack" Version="1.12.1" />
99
<PackageReference Include="HtmlAgilityPack.CssSelectors.NetCore" Version="1.2.1" />
10-
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
10+
<PackageReference Include="TimeZoneConverter" Version="7.0.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

Grabbers/livesoccertv.com/WebSiteGrabber.cs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,29 @@ namespace livesoccertv.com
1313
{
1414
public class WebSiteGrabber : GrabberBase
1515
{
16+
string[] userAgents = {
17+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0",
18+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0",
19+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0"
20+
};
21+
22+
int _userAgentCounter = 0;
23+
24+
string GetNextUserAgent()
25+
{
26+
if (_userAgentCounter >= userAgents.Length)
27+
{
28+
_userAgentCounter = 0;
29+
}
30+
return userAgents[_userAgentCounter++];
31+
}
32+
1633
public override List<Show> Grab(string xmlParameters, ILogger logger)
1734
{
35+
const string ErrorPrefix = "livesoccertv.com";
36+
37+
logger.WriteEntry("Started livesoccertv.com grab", LogType.Info);
38+
1839
var shows = new List<Show>();
1940

2041
const string BaseUrl = "https://www.livesoccertv.com/channels/";
@@ -28,7 +49,7 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
2849
logger.WriteEntry($"Grabbing Channel {channel}", LogType.Info);
2950
var url = $"{BaseUrl}{channel}/";
3051
var wr = (HttpWebRequest)WebRequest.Create(url);
31-
wr.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0";
52+
wr.UserAgent = GetNextUserAgent();
3253
wr.Timeout = 10000;
3354
var channelShows = new List<Show>();
3455
using (var res = wr.GetResponse())
@@ -43,8 +64,8 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
4364
{
4465
var show = new Show();
4566
show.Channel = channel;
46-
show.Title = row.QuerySelector("td[id=match]").InnerText;
47-
show.Description = row.QuerySelector("td.compcell_right").InnerText;
67+
show.Title = row.QuerySelector("td[id=match]").InnerText?.Trim();
68+
show.Description = row.QuerySelector("td.compcell_right").InnerText?.Trim();
4869
var el = row.QuerySelector("td.timecol span.ts");
4970
if (el != null)
5071
{
@@ -54,7 +75,7 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
5475
}
5576
catch (Exception ex)
5677
{
57-
logger.LogException(ex);
78+
logger.LogException(ex, ErrorPrefix);
5879
}
5980
}
6081
}
@@ -64,9 +85,10 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
6485
}
6586
catch (Exception ex)
6687
{
67-
logger.LogException(ex);
88+
logger.LogException(ex, ErrorPrefix);
6889
}
6990
}
91+
logger.WriteEntry("Finished livesoccertv.com grab", LogType.Info);
7092
return shows;
7193
}
7294
}

Grabbers/livesoccertv.com/livesoccertv.com.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="HtmlAgilityPack" Version="1.11.63" />
8+
<PackageReference Include="HtmlAgilityPack" Version="1.12.1" />
99
<PackageReference Include="HtmlAgilityPack.CssSelectors.NetCore" Version="1.2.1" />
1010
</ItemGroup>
1111

Grabbers/nos.pt/nos.pt.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="HtmlAgilityPack.CssSelectors.NetCore" Version="1.2.1" />
9-
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
9+
<PackageReference Include="TimeZoneConverter" Version="7.0.0" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

Grabbers/ontvtonight.com/ontvtonight.com.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="HtmlAgilityPack.CssSelectors.NetCore" Version="1.2.1" />
9-
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
9+
<PackageReference Include="TimeZoneConverter" Version="7.0.0" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

Grabbers/ontvtonight.com/ontvtonight.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
8282
}
8383
catch (Exception ex)
8484
{
85-
logger.LogException(ex);
85+
logger.LogException(ex, "ontvtonight.com");
8686
}
8787
}
8888

Grabbers/streamingtvguides.com/WebSiteGrabber.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public override List<Show> Grab(string xmlParameters, ILogger logger)
8080
}
8181
catch (Exception ex)
8282
{
83-
logger.LogException(ex);
83+
logger.LogException(ex, "streamingtvguides.com");
8484
}
8585
}
8686

Grabbers/streamingtvguides.com/streamingtvguides.com.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="HtmlAgilityPack.CssSelectors.NetCore" Version="1.2.1" />
9-
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
9+
<PackageReference Include="TimeZoneConverter" Version="7.0.0" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)