<commit_before>#!/bin/bash

# <bitbar.title>Play Url</bitbar.title>
# <bitbar.version>v0.1</bitbar.version>
# <bitbar.author><NAME></bitbar.author>
# <bitbar.author.github>gunasekar</bitbar.author.github>
# <bitbar.desc>This plugin will play the url in clipboard using mpv</bitbar.desc>

# Hack for language not being set properly and unicode support
export LANG="${LANG:-en_US.UTF-8}"

if [[ "$1" == "play" ]]; then
    tmp=$(pbpaste)
    /usr/local/bin/mpv --ytdl-format="$2" $tmp
    exit
fi

echo "📽️"
echo '---'
echo "Play Url (360p) | bash='$0' param1=play param2="bestvideo[height\<\=\?360]+bestaudio/best" terminal=false"
echo "Play Url (720p) | bash='$0' param1=play param2="bestvideo[height\<\=\?720]+bestaudio/best" terminal=false"
echo "Play Url (1080p) | bash='$0' param1=play param2="bestvideo[height\<\=\?1080]+bestaudio/best" terminal=false"
echo "Play Url (Max) | bash='$0' param1=play terminal=false"
echo "---"<commit_msg>Added comment for the pre-requisites of this plugin<commit_after>#!/bin/bash

# <bitbar.title>Play Url</bitbar.title>
# <bitbar.version>v0.1</bitbar.version>
# <bitbar.author><NAME></bitbar.author>
# <bitbar.author.github>gunasekar</bitbar.author.github>
# <bitbar.desc>This plugin will play the url in clipboard using mpv</bitbar.desc>

# Hack for language not being set properly and unicode support
export LANG="${LANG:-en_US.UTF-8}"

# mpv and youtube-dl needs to be installed. Use 'brew install mpv' and 'brew install youtube-dl'
if [[ "$1" == "play" ]]; then
    tmp=$(pbpaste)
    /usr/local/bin/mpv --ytdl-format="$2" $tmp
    exit
fi

echo "📽️"
echo '---'
echo "Play Url (360p) | bash='$0' param1=play param2="bestvideo[height\<\=\?360]+bestaudio/best" terminal=false"
echo "Play Url (720p) | bash='$0' param1=play param2="bestvideo[height\<\=\?720]+bestaudio/best" terminal=false"
echo "Play Url (1080p) | bash='$0' param1=play param2="bestvideo[height\<\=\?1080]+bestaudio/best" terminal=false"
echo "Play Url (Max) | bash='$0' param1=play terminal=false"
echo "---"
{'fraction_non_alphanumeric': 0.1908775409023302, 'fraction_numerical': 0.035696579077838374, 'mean_word_length': 5.115151515151515, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7460367', 'n_tokens_mistral': 808, 'n_tokens_neox': 752, 'n_words': 168}