Rickroll Detector
MIT License
Site | Method |
---|---|
YouTube | Content ID |
YouTube and Content ID are respective trademarks of Google LLC.
from rolldet import Detector
async def main():
det = Detector()
result = await det.find("https://youtu.be/6-HUgzYPm9g")
print(result)
if result.is_roll:
print("Rickroll detected!")
Detector.find
is a coroutine that returns a DetectionResult
url -> "https://youtu.be/6-HUgzYPm9g"
redirect_url -> "https://www.youtube.com/watch?v=6-HUgzYPm9g"
is_roll -> True
error -> None
song -> "Never Gonna Give You Up"
artist -> "Rick Astley"
dict
or json
stringsjson
conversion will not have None
value keysresult.as_dict() ->
{'url': URL('https://youtu.be/6-HUgzYPm9g'), 'redirect_url': URL('https://www.youtube.com/watch?v=Uj1ykZWtPYI'), 'is_roll': True, 'error': None, 'song': 'Never Gonna Give You Up', 'artist': 'Rick Astley'}
result.json() ->
{"url": "https://youtu.be/6-HUgzYPm9g", "redirect_url": "https://www.youtube.com/watch?v=Uj1ykZWtPYI", "is_roll": true, "song": "Never Gonna Give You Up", "artist": "Rick Astley"}
The code in this template is released under the MIT License.