1
0
mirror of https://github.com/XFox111/GUTSchedule.git synced 2026-04-22 06:58:01 +03:00

- Fixed export failing

- Remote lessons are now appropriately marked
This commit is contained in:
Michael Gordeev
2021-02-17 18:08:50 +03:00
parent e8a4ad5c98
commit 39dd29c4e9
6 changed files with 29 additions and 6 deletions
+14 -1
View File
@@ -338,6 +338,12 @@ namespace GUTSchedule
("month", date.Month.ToString()),
("year", date.Year.ToString()),
("type_z", "0"));
request.Headers.UserAgent.Clear();
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Mozilla", "5.0"));
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("AppleWebKit", "537.36"));
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Chrome", "88.0.4324.150"));
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Safari", "537.36"));
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Edg", "88.0.705.68"));
HttpResponseMessage response = await client.SendAsync(request).ConfigureAwait(false);
string responseContent = await response.GetString().ConfigureAwait(false);
@@ -367,7 +373,14 @@ namespace GUTSchedule
i.QuerySelectorAll("i")[k].NextSibling.NextSibling.NextSibling.TextContent : "";
try { item.Cabinet = i.QuerySelectorAll("small")[k].NextSibling.TextContent.Replace(" ", "").Replace(";Б22", ""); }
catch { item.Cabinet = "СПбГУТ"; }
catch
{
INode cab = i?.QuerySelectorAll("b")[k * 2 + 2].NextSibling?.NextSibling;
if (cab?.NodeType == NodeType.Text)
item.Cabinet = cab.TextContent;
else
item.Cabinet = "СПбГУТ";
}
string rawTime = i.QuerySelectorAll("b")[k * 2 + 2].TextContent;
item.StartTime = new DateTime(
@@ -1 +1,3 @@
- Anonymous schedule export is temporarly disabled
- Anonymous schedule export is temporarly disabled
- Fixed export failing
- Remote lessons are now appropriately marked
@@ -1 +1,3 @@
- Анонимный экспорт расписания временно отключен
- Анонимный экспорт расписания временно отключен
- Исправлена проблема с экспортом расписания
- Теперь дистанционные пары отмечаются как "ДОТ"
+3 -1
View File
@@ -1,2 +1,4 @@
## Core
- Anonymous schedule export is temporarly disabled
- Anonymous schedule export is temporarly disabled
- Fixed export failing
- Remote lessons are now appropriately marked
@@ -1 +1,3 @@
- Anonymous schedule export is temporarly disabled
- Anonymous schedule export is temporarly disabled
- Fixed export failing
- Remote lessons are now appropriately marked
@@ -1 +1,3 @@
- Анонимный экспорт расписания временно отключен
- Анонимный экспорт расписания временно отключен
- Исправлена проблема с экспортом расписания
- Теперь дистанционные пары отмечаются как "ДОТ"