Remove blocked instances from listing

This commit is contained in:
Omar Roth 2020-02-01 11:17:58 -05:00
parent 3a8481e453
commit abf3c4e53f
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2

View file

@ -56,6 +56,7 @@ spawn do
body = HTTP::Client.get(URI.parse("https://raw.githubusercontent.com/wiki/omarroth/invidious/Invidious-Instances.md")).body
headers = HTTP::Headers.new
body = body.split("### Blocked:")[0]
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("") }
flag = md["region"]?