feat: implement RSS generation modules for X lists, YouTube playlists, and CI-EN content
This commit is contained in:
1 parent
46808590c6
commit
44864cde19
7 files changed
+19
-20
No files matched your search
@@ -384,14 +384,14 @@ public class CmnUtil
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Feed を非同期でファイルに出力します。画像 Base64 変換が有効な場合は自動で変換を行います。
|
||||
/// Feed を非同期でファイルに出力します。画像 Base64 変換が有効な場合は自動で変換を行います(Pixiv のみ有効)。
|
||||
/// </summary>
|
||||
/// <param name="fileName">出力先ファイル名</param>
|
||||
/// <param name="feed">SyndicationFeed</param>
|
||||
/// <param name="client">画像ダウンロード用 HttpClient</param>
|
||||
/// <param name="addDir">サブディレクトリ</param>
|
||||
/// <param name="embedBase64">画像を Base64 変換するかどうか(false の場合は通常の画像リンクを維持)</param>
|
||||
public static async Task ExportXMLFileAsync(string fileName, SyndicationFeed feed, HttpClient? client = null, string addDir = "", bool embedBase64 = true)
|
||||
/// <param name="embedBase64">画像を Base64 変換するかどうか(Pixiv 以外は false)</param>
|
||||
public static async Task ExportXMLFileAsync(string fileName, SyndicationFeed feed, HttpClient? client = null, string addDir = "", bool embedBase64 = false)
|
||||
{
|
||||
// 24時間以上前の古い記事を除外
|
||||
if (feed.Items != null)
|
||||
|
||||
@@ -587,7 +587,8 @@ internal static class pixiv_common
|
||||
items
|
||||
);
|
||||
|
||||
await CmnUtil.ExportXMLFileAsync(fileName, feed, client);
|
||||
// Pixiv は Base64 画像埋め込みを有効にして出力する
|
||||
await CmnUtil.ExportXMLFileAsync(fileName, feed, client, embedBase64: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -90,7 +90,8 @@ internal class x_list
|
||||
simplifiedItems
|
||||
);
|
||||
|
||||
await CmnUtil.ExportXMLFileAsync($"{fileName}.xml", mergedFeed, client);
|
||||
// X (Twitter) は画像リンクを Base64 変換せず、通常の画像リンクとして出力する
|
||||
await CmnUtil.ExportXMLFileAsync($"{fileName}.xml", mergedFeed, client, embedBase64: false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -354,7 +354,8 @@ public static class YouTubeFeedManager
|
||||
distinctItems
|
||||
);
|
||||
|
||||
await CmnUtil.ExportXMLFileAsync(fileName, feed, client, YouTubeConfig.OutputSubDir);
|
||||
// YouTube は画像リンクを Base64 変換せず、通常の画像リンクとして出力する
|
||||
await CmnUtil.ExportXMLFileAsync(fileName, feed, client, YouTubeConfig.OutputSubDir, embedBase64: false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -50,7 +50,8 @@ internal class Youtube
|
||||
items
|
||||
);
|
||||
|
||||
await CmnUtil.ExportXMLFileAsync($"{fileName}.xml", mergedFeed, client, "youtube");
|
||||
// YouTube は画像リンクを Base64 変換せず、通常の画像リンクとして出力する
|
||||
await CmnUtil.ExportXMLFileAsync($"{fileName}.xml", mergedFeed, client, "youtube", embedBase64: false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -183,7 +183,8 @@ internal class ci_en
|
||||
}
|
||||
feed.Items = items;
|
||||
|
||||
await CmnUtil.ExportXMLFileAsync("ci_en.xml", feed, client);
|
||||
// ci_en は画像リンクを Base64 変換せず、通常の画像リンクとして出力する
|
||||
await CmnUtil.ExportXMLFileAsync("ci_en.xml", feed, client, embedBase64: false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user