2021-02-24 11:26:54 +01:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
// patch hook for https://git.sakamoto.pl/laudompat/copykitku
|
|
|
|
|
|
|
|
module.exports = function patchHook(patchContent) {
|
|
|
|
[
|
2021-02-26 14:27:42 +01:00
|
|
|
[/(?:youtube-|yt-?)dl\.org/g, 'haruhi.download'],
|
2021-04-05 02:44:06 +02:00
|
|
|
|
|
|
|
// fork: https://github.com/blackjack4494/yt-dlc
|
|
|
|
[/youtube_dlc/g, 'haruhi_dl'],
|
|
|
|
[/youtube-dlc/g, 'haruhi-dl'],
|
|
|
|
[/ytdlc/g, 'hdl'],
|
|
|
|
[/yt-dlc/g, 'hdl'],
|
|
|
|
// fork: https://github.com/yt-dlp/yt-dlp
|
|
|
|
[/yt_dlp/g, 'haruhi_dl'],
|
|
|
|
[/yt-dlp/g, 'haruhi-dl'],
|
|
|
|
[/ytdlp/g, 'hdl'],
|
|
|
|
|
2021-02-24 11:26:54 +01:00
|
|
|
[/youtube_dl/g, 'haruhi_dl'],
|
|
|
|
[/youtube-dl/g, 'haruhi-dl'],
|
|
|
|
[/youtubedl/g, 'haruhidl'],
|
|
|
|
[/YoutubeDL/g, 'HaruhiDL'],
|
|
|
|
[/ytdl/g, 'hdl'],
|
|
|
|
[/yt-dl/g, 'h-dl'],
|
2021-02-26 14:27:42 +01:00
|
|
|
[/ydl/g, 'hdl'],
|
2021-02-24 11:26:54 +01:00
|
|
|
|
|
|
|
// prevent from linking to non-existent repository
|
2021-03-20 20:23:58 +01:00
|
|
|
[/github\.com\/(?:yt|h)dl-org\/haruhi-dl/g, 'github.com/ytdl-org/youtube-dl'],
|
2021-02-26 14:27:42 +01:00
|
|
|
[/github\.com\/rg3\/haruhi-dl/g, 'github.com/ytdl-org/youtube-dl'],
|
2021-04-05 02:44:06 +02:00
|
|
|
[/github\.com\/blackjack4494\/hdl/g, 'github.com/blackjack4494/yt-dlc'],
|
|
|
|
[/github\.com\/hdl\/hdl/g, 'github.com/yt-dlp/yt-dlp'],
|
2021-02-24 11:26:54 +01:00
|
|
|
// prevent changing the smuggle URLs (for compatibility with ytdl)
|
|
|
|
[/__haruhidl_smuggle/g, '__youtubedl_smuggle'],
|
|
|
|
].forEach(([regex, replacement]) => patchContent = patchContent.replace(regex, replacement));
|
|
|
|
return patchContent;
|
|
|
|
}
|