A simple command line interface for listening to Quran.

Overview

Quran-CLI

A simple command line interface for listening to Quran.

GitHub contributors GitHub issues GitHub forks GitHub stars GitHub license

Used API

We are using the mp3quran api.

Dependencies

  • Install mpv as it is required for playing the audio.
    • Debian based distributions sudo add-apt-repository ppa:mc3man/mpv-tests sudo apt update && sudo apt install mpv
    • Windows Follow This link

How to use

  • To use without installing the package: npx @quran-cli/q-cli [options]
  • Or install it globally: sudo npm install @quran-cli/q-cli -g and use it as q-cli [options]
  • To show the version: q-cli -v
  • To show help: q-cli -h
Quran-CLI

  Listen to the Quran from your terminal 

Options

  -n, --showRadios              Shows all available radio channels                                            
  -d, --radio number            Play specific radio                                                           
  -c, --reciterSurah number[]   lay specific surah by a specific reciter.                                     
                                If no surah specified, it will shows the available suras for the specified    
                                reciter.                                                                      
  -r, --showReciters            Shows all available reciters                                                  
  -s, --showSuras               Show all suras in the Quran                                                   
  -v, --version                 Shows the current version                                                     
  -h, --help                    Prints this usage guide                                                       

^_^

  Recall us in your doa'!  
  • Show all available radio channels: q-cli -n
  • Play specific radio: q-cli -d <radio index>
  • Show all available reciters: q-cli -r
  • Play specific surah by a specific reciter: q-cli -c <reciter index> <surah index>
  • Show all available suras by a specific reciter : q-cli -c <reciter index>
  • Show all suras in the Quran: q-cli -s

How to build locally

  • Install typescript using: npm install -g typescript if you do not have typescript globally
  • Install dependencies: npm install
  • Build the source files: npm run build
  • Run the index: node src/index.js [options]
Comments
  • [Bug] Test Case 007: Exception Is Thrown Using an Odd Flag

    [Bug] Test Case 007: Exception Is Thrown Using an Odd Flag

    Steps to reproduce

    1. Open the project directory
    2. Open a terminal in the project directory
    3. Run command node quran-cli.js -z in terminal

    Expected behavior (correct)

    A warning message should be displayed to the user that he used an undefined flag and display the usage guide alongside the message.

    Current behavior (bug)

    Throw an Exception.

    Environment

    ubuntu 22.04

    Relevant logs and/or media (optional)

    Write here or upload an image/video
    
    /home/we2am/Desktop/Github/Quran-cli/node_modules/command-line-args/dist/index.js:1377
            throw err
            ^
    
    UNKNOWN_OPTION: Unknown option: -z
        at Object.commandLineArgs [as default] (/home/we2am/Desktop/Github/Quran-cli/node_modules/command-line-args/dist/index.js:1374:21)
        at parse (/home/we2am/Desktop/Github/Quran-cli/node_modules/ts-command-line-args/dist/parse.js:60:49)
        at Function.CommandLine.getArgs (/home/we2am/Desktop/Github/Quran-cli/utilities/parser.js:9:53)
        at Object.<anonymous> (/home/we2am/Desktop/Github/Quran-cli/quran-cli.js:6:33)
        at Module._compile (internal/modules/cjs/loader.js:999:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
        at Module.load (internal/modules/cjs/loader.js:863:32)
        at Function.Module._load (internal/modules/cjs/loader.js:708:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
        at internal/main/run_main_module.js:17:47 {
      optionName: '-z'
    }
    

    image

    Root Cause Analysis

    Invalid flags not handled.

    Other Comments

    bug 
    opened by We2Am-BaSsem 1
  • [Bug] Test Case 003: Warning messages does not show

    [Bug] Test Case 003: Warning messages does not show

    Steps to reproduce

    1. Open the project directory
    2. Open a terminal in the project directory
    3. Run command node quran-cli.js -d -1 in terminal

    Expected behavior (correct)

    The program should not run and display a warning message informing to the user of the valid radio range

    the message that should be displayed: image

    Current behavior (bug)

    The program doesn't run at all image

    Environment

    ubuntu 22.04

    Root Cause Analysis

    Not Known Yet

    bug 
    opened by We2Am-BaSsem 1
  • [Bug] Process Exit With Exception

    [Bug] Process Exit With Exception

    Steps to reproduce

    1. Open the project directory
    2. Open a terminal in the project directory
    3. Run command python3 quran_cli.py -rd 0 in terminal
    4. Wait until the radio works
    5. press CTRL + C to kill the process

    Expected behaviour (correct)

    The process should be safely(exited without exception)

    Current behaviour (bug)

    Exit with Exception

    Environment

    ubuntu 22.04

    Relevant logs and/or media (optional)

    Write here or upload an image/video
    
    Radio Name:  ---Amazing short Recitations---
     (+) Audio --aid=1 (mp3 2ch 44100Hz)
    AO: [pulse] 44100Hz stereo 2ch float
    A: 00:00:01 / 00:00:13 (8%) Cache: 11s/408KB
    File tags:
     icy-title: 339-محمد حكمي - نرفع درجات من نشاء
    A: 00:00:03 / 00:00:19 (20%) Cache: 15s/552KB
    
    Exiting... (Quit)
    Traceback (most recent call last):
      File "/home/we2am/Desktop/Github/Quran-cli/quran_cli.py", line 24, in <module>
        radioMode(radioIndex)
      File "/home/we2am/Desktop/Github/Quran-cli/modes/radioMode.py", line 86, in radioMode
        runRadio(radioIndex)
      File "/home/we2am/Desktop/Github/Quran-cli/modes/radioMode.py", line 70, in runRadio
        runFromURL(getRadioURL(radioIndex))
      File "/home/we2am/Desktop/Github/Quran-cli/utilities/helperFunctions.py", line 38, in runFromURL
        subprocess.call(["mpv", url])
      File "/usr/lib/python3.10/subprocess.py", line 347, in call
        return p.wait(timeout=timeout)
      File "/usr/lib/python3.10/subprocess.py", line 1204, in wait
        return self._wait(timeout=timeout)
      File "/usr/lib/python3.10/subprocess.py", line 1938, in _wait
        (pid, sts) = self._try_wait(0)
      File "/usr/lib/python3.10/subprocess.py", line 1896, in _try_wait
        (pid, sts) = os.waitpid(self.pid, wait_flags)
    KeyboardInterrupt
    
    

    image

    Root Cause Analysis

    the audio player was displayed and closing the process was causing exceptions due to closing the player

    Other Comments

    solved in issue commit: remove audio diplay

    bug 
    opened by We2Am-BaSsem 1
  • [Bug] Windows - process is started in background

    [Bug] Windows - process is started in background

    Reproduction: 1- In cmd or powershell: run any playback command q-cli -d 0 2- Immediate output: Finished playing while playback is continued in the background 3- Can't Ctrl-c to stop, have to kill process with powershell -c "kill -Name mpv" On linux (WSL) Ctrl-c works just fine

    My Build: 1- Windows 10 21H2 (19044.1766) 2- mpv installed using scoop 3- package installed using npm install @quran-cli/q-cli -g in admin mode powershell

    opened by GhiathAjam 2
  • A Way to Pause and Stop mpv

    A Way to Pause and Stop mpv

    Provide a way to pause and stop the playing without just brutely killing the process may be like this ~ ❯ ps -ef | grep mpv | grep -v grep | awk '{print $2}' | xargs -n1 kill -9

    opened by BigFish2086 6
  • [Feature] More detailed instructions for windows

    [Feature] More detailed instructions for windows

    We should add more detailed instructions for installing both MPV and node on windows. A script for installing both would be better of course. The same applies to other Linux distros.

    opened by Mostafa-wael 0
Releases(v1.1.1)
Owner
Mostafa Wael
“Make it work, make it right, make it fast.” – Kent Beck
Mostafa Wael
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
✨ A command-line interface for quickly sharing code snippets of your local files

?? snipli ✨ A command-line interface for quickly sharing code snippets for your local files Usage Commands Usage $ npm install -g snipli $ snipli COMM

Kira 146 Nov 3, 2022
✨ A command-line interface for quickly sharing code snippets of your local files

?? snipli ✨ A command-line interface for quickly sharing code snippets for your local files Usage Commands Usage $ npm install -g snipli $ snipli COMM

buidler's hub 127 May 11, 2022
CloudCrafter CLI is a command-line interface tool that provides templates for common cloud resources to help you get started quickly.

CloudCrafter CLI CloudCrafter CLI is a command-line interface tool that provides templates for common cloud resources to help you get started quickly.

Missio 7 May 5, 2023
Get a verse(an aya) from the Quran during your coding session 💻 , stay connected with the words of Allah. 🕋

Ayat ?? Get a verse(an aya) from the Quran during your coding session ?? stay connected with the words of Allah. ?? ?? Release Notes 1.0.0 Get random

Hussam Adil 27 Jan 2, 2023
Project Cider. A new look into listening and enjoying Apple Music in style and performance. 🚀

Links Wiki Request Feature Report Bug View The Releases Install Sources Compiling and Configuration For more information surrounding configuration, co

Cider Collective 5.8k Jan 5, 2023
App that leverages GPT-3 to facilitate new language listening and speaking practice.

Talk w/GPT-3 app: Getting started The Talk w/GPT-3 application was developed by James L. Weaver (the author of this document) to get more new language

James Weaver 47 Jan 1, 2023
Keep the type of storage value unchanged and change array and object directly. Supports listening to the changes and setting expires.

proxy-web-storage A more convenient way to use storage through proxy. try it on codesandbox. Install npm i proxy-web-storage Features Base Keep the ty

null 221 Dec 25, 2022
A tiny, SSR-friendly hook for listening to gamepad events.

useGamepadEvents useGamepadEvents is a tiny, SSR-friendly hook for listening to gamepad events. It's a wrapper around the Gamepad API designed for fir

Hayden Bleasel 2 Oct 2, 2022
An Awesome Toggle Menu created with HTML,CSS,JQuery,font-awesome and line by line comment.

Demo : https://blackx-732.github.io/AwesomeMenu/ Under open source license No ©copyright issues Anyone can be modify this code as well Specifically we

BlackX-Lolipop 2 Feb 9, 2021
🎨ansi escape code generator to help make colorful command line tools

ansicodes ?? ansi escape code generator to help make colorful command line tools i got tired of looking up ansi code tables when writing command line

Gabe Banks 53 Dec 17, 2022
enables communication between command-line or desktop applications and browser-based Ethereum wallets such as Metamask.

@securerpc/walletbus @securerpc/walletbus Abstract Quickstart Installation Usage Ethers.js Web3.js Configuration options Logging Development Automated

Manifold Finance 8 Dec 27, 2022
🦄 A command line tool to get tokens on testnets quickly!

?? faucetli A command line tool to get tokens on testnets quickly! Usage Commands Usage $ npm install -g faucetli $ faucetli COMMAND running command..

Kira 60 Jan 1, 2023
A command-line tool to convert Project Zomboid map data into Deep Zoom format

pzmap2dzi pzmap2dzi is a command-line tool running on Windows to convert Project Zomboid map data into Deep Zoom format. Features Supports both python

Min Xiang 14 Dec 31, 2022
Command line tool that automatically migrates tests from protractor to playwright.

Protractor to Playwright migration tool This tool is designed to automatically migrate code from Protractor to Playwright. It is inspired by the "Migr

Amadeus IT Group 9 Nov 20, 2022
Offline rendering examples at the command line with Node.js

Elementary Audio Offline Rendering Examples This repository holds a set of small examples using Elementary in Node.js to process audio files. Each sub

Elementary Audio 8 Jun 12, 2022
Command line tool that converts HTML to markdown.

@wcj/html-to-markdown HTML conversion tool to markdown. command line tool => @wcj/html-to-markdown-cli. Installation This package is ESM only: Node 14

小弟调调™ 11 Nov 6, 2022