Skip to content

Instantly share code, notes, and snippets.

@omarroth omarroth/geo-bypass.cr
Last active Oct 3, 2018

Embed
What would you like to do?
Script used to generate geo-bypass.txt
require "http"
require "json"
ids = File.read("geo-blocked-ids.txt").split("\n")
threads = 40
loop do
id_channel = Channel(String | Nil).new
if ids.empty?
break
end
threads.times do
id = ids.shift
spawn do
begin
response = HTTP::Client.get(URI.parse("https://invidio.us/api/v1/videos/#{id}"))
response = JSON.parse(response.body)
if response["error"]?
next id_channel.send("#{id} - #{response["error"].as_s.gsub("\n", " ")}")
end
if !response["allowedRegions"].as_a.includes? "US"
next id_channel.send("#{id} *")
else
next id_channel.send(nil)
end
rescue ex
id_channel.send(nil)
end
end
end
threads.times do |response|
response = id_channel.receive
if response
puts response
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.