From 641f8eceb9db97f235fbfdbe59958157ec97f610 Mon Sep 17 00:00:00 2001 From: Hansly Saw <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sat, 30 Apr 2022 17:00:47 +0800 Subject: [PATCH] Adjusted error messages. --- Kpop'minal.ipynb | 75 ++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 44 deletions(-) diff --git a/Kpop'minal.ipynb b/Kpop'minal.ipynb index cee51ee..4f6cc2e 100644 --- a/Kpop'minal.ipynb +++ b/Kpop'minal.ipynb @@ -1,63 +1,31 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "name": "Kpop'minal.ipynb", - "provenance": [], - "collapsed_sections": [], - "private_outputs": true, - "authorship_tag": "ABX9TyOKzpUDluOXYqmRr/JITg5H", - "include_colab_link": true - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - }, - "accelerator": "GPU" - }, "cells": [ { "cell_type": "markdown", "metadata": { - "id": "view-in-github", - "colab_type": "text" + "id": "TK6pOEjtZCFB" }, - "source": [ - "\"Open" - ] - }, - { - "cell_type": "markdown", "source": [ "# Kpop'minal\n", "Watch k-pop music videos in an ASCII format. \n", "\n", "_Uses [`video-to-ascii` by joelibaceta](https://github.com/joelibaceta/video-to-ascii)_. " - ], - "metadata": { - "id": "TK6pOEjtZCFB" - } + ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "id": "NKYqnAEwCPYG", - "cellView": "form" + "cellView": "form", + "id": "NKYqnAEwCPYG" }, "outputs": [], "source": [ "# KPOP'MINAL\n", "# Watch k-pop music videos in an ASCII format. \n", "\n", - "import os\n", - "import subprocess\n", - "from google.colab import files\n", - "from google.colab import output\n", + "import os; import subprocess\n", + "from google.colab import files; from google.colab import output\n", "from IPython.display import Audio\n", "\n", "# selections\n", @@ -161,7 +129,7 @@ " selection.videoURL = musicvideos[selection.artist][selection.video]\n", " \n", " except:\n", - " info.err('The video that you are looking for does not exist. Make sure you have typed it properly. If you did, you can safely assume that this script is not updated. ')\n", + " info.err(formatting.font.bold + 'The video that you are looking for does not exist. ' + formatting.clear + 'Make sure you have typed it properly. If you did, you can safely assume that this script is not updated. ')\n", " os.kill(os.getpid(), 1)\n", " \n", " def start_download():\n", @@ -177,7 +145,7 @@ " info.status('Downloading the music video…')\n", "\n", " if os.system('curl ' + selection.videoURL + ' -o video.mp4') > 0:\n", - " info.err('The download has failed, please re-run this script again. '); os.system('rm -rf video.mp4 -v')\n", + " info.err(formatting.font.bold + 'The download has failed, ' + formatting.clear + 'please re-run this script again. Kindly check the log for more details.'); os.system('rm -rf video.mp4 -v')\n", " if check_exists(\"old\"): os.system('mv video.old.mp4 video.mp4 -v')\n", " os.kill(os.getpid(), 1)\n", " else:\n", @@ -205,7 +173,7 @@ " info.success('The music video has been successfully processed. ')\n", " else:\n", " if check_file_exists(\"old\"): os.system('mv output.old.sh output.sh -v')\n", - " info.err('Unfortunately, an error may have ocurred during processing, and we apologize for the inconvenience. Kindly check the log for full details.')\n", + " info.err('Unfortunately, an error may have ocurred during processing. Kindly check the log for full details.')\n", " os.kill(os.getpid(), 1)\n", "\n", " attemptReplace()\n", @@ -221,7 +189,6 @@ " else:\n", " info.success('The file was succesfully downloaded.')\n", "\n", - "\n", "def main():\n", " get_dependencies()\n", " download_video()\n", @@ -231,5 +198,25 @@ "main()" ] } - ] -} \ No newline at end of file + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "authorship_tag": "ABX9TyOKzpUDluOXYqmRr/JITg5H", + "collapsed_sections": [], + "include_colab_link": true, + "name": "Kpop'minal.ipynb", + "private_outputs": true, + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}