mirror of
https://github.com/iv-org/instances-api.git
synced 2025-02-09 19:38:27 -05:00
Remove blocked instances from listing
This commit is contained in:
parent
3a8481e453
commit
abf3c4e53f
@ -56,6 +56,7 @@ spawn do
|
|||||||
body = HTTP::Client.get(URI.parse("https://raw.githubusercontent.com/wiki/omarroth/invidious/Invidious-Instances.md")).body
|
body = HTTP::Client.get(URI.parse("https://raw.githubusercontent.com/wiki/omarroth/invidious/Invidious-Instances.md")).body
|
||||||
headers = HTTP::Headers.new
|
headers = HTTP::Headers.new
|
||||||
|
|
||||||
|
body = body.split("### Blocked:")[0]
|
||||||
body.scan(/\[(?<host>[^ \]]+)\]\((?<uri>[^\)]+)\)( .(?<region>[\x{1f100}-\x{1f1ff}]{2}))?/mx).each do |md|
|
body.scan(/\[(?<host>[^ \]]+)\]\((?<uri>[^\)]+)\)( .(?<region>[\x{1f100}-\x{1f1ff}]{2}))?/mx).each do |md|
|
||||||
region = md["region"]?.try { |region| region.codepoints.map { |codepoint| (codepoint - 0x1f1a5).chr }.join("") }
|
region = md["region"]?.try { |region| region.codepoints.map { |codepoint| (codepoint - 0x1f1a5).chr }.join("") }
|
||||||
flag = md["region"]?
|
flag = md["region"]?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user