<jupyter_start><jupyter_text><jupyter_code>#@markdown <h3>⬅️ Run This Cell to Mount Gdrive</h3>
from google.colab import drive
drive.mount('/content/drive')
#@markdown <h3>⬅️ Run This Cell to Export Album Art from FLAC Audio</h3>
Flac_Path = "" #@param {type:"string"}
Save_Path = "" #@param {type:"string"}

import IPython
import ipywidgets as widgets

from IPython.display import HTML, clear_output

loadingBtn = widgets.Button(description = "Exporting",
                          disabled = True,
                          button_style = 'info', # 'success', 'info', 'warning', 'danger' or '' 
                          tooltip = "Exporting",
                          icon = 'check')
display(loadingBtn)

get_ipython().system_raw("rm -rf /content/sample_data/ && sudo apt update && sudo apt install software-properties-common")
get_ipython().system_raw("pip3 -q install mutagen")

%cd $Save_Path
clear_output()

from mutagen.flac import FLAC, Picture
song = Flac_Path
var = FLAC(song)
pics = var.pictures
print (pics)
for p in pics:
    if p.type == 3: #front cover
        display(HTML("<center><h2 style=\"font-family:Trebuchet MS;color:#00b24c;\">Album Art Successfully Exported!</h2><br></center>")) 
        with open("cover.jpg", "wb") as f:
            f.write(p.data)
#@markdown <h3>⬅️ Run This Cell to Check FLAC files</h3>
Path = "" #@param {type:"string"}

import IPython
import ipywidgets as widgets

from IPython.display import HTML, clear_output
loadingBtn = widgets.Button(description = "Checking",
                          disabled = True,
                          button_style = 'info', # 'success', 'info', 'warning', 'danger' or '' 
                          tooltip = "Checking",
                          icon = 'check')
display(loadingBtn)

get_ipython().system_raw("apt-get install file")

%cd $Path
clear_output()

try:
  get_ipython().system_raw("find . -iname *.flac -exec file {} \; > output.txt")
  display(HTML("<center><h2 style=\"font-family:Trebuchet MS;color:#00b24c;\">Success</h2><br></center>"))
except:
  display(HTML("<center><h2 style=\"font-family:Trebuchet MS;color:#ce2121;\">Failed</h2><br></center>"))
#@markdown <h3>⬅️ Run This to Upload Images to imgur.com</h3>
#@markdown <h4>📝 get your CLIENT ID from https://api.imgur.com/oauth2/addclient</h4>
CLIENT = "" #@param {type:"string"}
PATH = "" #@param {type:"string"}

get_ipython().system_raw("pip3 -q install pyimgur")
clear_output()

import IPython, os
import pyimgur
import ipywidgets as widgets

from IPython.display import HTML, clear_output

loadingBtn = widgets.Button(description = "Uploading",
                          disabled = True,
                          button_style = 'info', # 'success', 'info', 'warning', 'danger' or '' 
                          tooltip = "Uploading",
                          icon = 'check')
display(loadingBtn)


im = pyimgur.Imgur(CLIENT)
uploaded_image = im.upload_image(PATH, title="ULED via Kenway IMGUR Uploader")
print(uploaded_image.title)
print(uploaded_image.link)
print(uploaded_image.size)
print(uploaded_image.type)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1450676982591876, 'fraction_numerical': 0.010315925209542231, 'mean_word_length': 3.2623626373626373, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 31, 'https://': 1, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '661710', 'license': 'MIT', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1009, 'n_words': 242, 'path': 'FLAC_Album_Art_Extract_&_FLAC_Checker_[KENWAY].ipynb', 'repo_name': 'K-E-N-W-A-Y/FLAC-Checker-Colab', 'size': '3102'}