Skip to content

Instantly share code, notes, and snippets.

View freeload101's full-sized avatar
💭
̷̢̛̬̤̼̬̠̝̳̮͈͍̞͔̼̮̠̫͈̟̙̱̦̦̘̖̹͈̬͇͉͙̣̯̩̫̙̫͓͈̦̋͆̒͂͂̆͊͛͛͑̋́̔̀̀͗͂̏̇͋̑̓̅͆́͘͜͜͝͠

Robert McCurdy freeload101

💭
̷̢̛̬̤̼̬̠̝̳̮͈͍̞͔̼̮̠̫͈̟̙̱̦̦̘̖̹͈̬͇͉͙̣̯̩̫̙̫͓͈̦̋͆̒͂͂̆͊͛͛͑̋́̔̀̀͗͂̏̇͋̑̓̅͆́͘͜͜͝͠
View GitHub Profile
@freeload101
freeload101 / plextoken.ps1
Created August 24, 2022 16:58 — forked from matt2005/plextoken.ps1
Plex x-token
$Credential=Get-Credential -Message 'Plex Credentials'
$url = "https://plex.tv/users/sign_in.xml"
$BB = [System.Text.Encoding]::UTF8.GetBytes($('{0}:{1}' -f $Credential.GetNetworkCredential().Username,$Credential.GetNetworkCredential().Password))
$EncodedPassword = [System.Convert]::ToBase64String($BB)
$headers = @{}
$headers.Add("Authorization","Basic $($EncodedPassword)") | out-null
$headers.Add("X-Plex-Client-Identifier","HASS") | Out-Null
$headers.Add("X-Plex-Product","Home Assistant") | Out-Null
$headers.Add("X-Plex-Version","V1") | Out-Null
[xml]$res = Invoke-RestMethod -Headers:$headers -Method Post -Uri:$url
@freeload101
freeload101 / vtt2text.py
Created September 27, 2021 14:11 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.