Giter Site home page Giter Site logo

cox890 / pyheadspace Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yashrathi-git/headspace-cli

0.0 0.0 0.0 270 KB

command-line script to download headspace packs, singles, or everyday meditation OR download all packs at once.

Home Page: https://pypi.org/project/pyheadspace/

License: MIT License

Python 100.00%

pyheadspace's Introduction

pyHeadspace

Command line script to download headspace packs, singles or everyday meditation.

demo

๐Ÿ‘ถ Dependencies

๐Ÿ› ๏ธ Installation

pip install --upgrade pyheadspace
  • If installing using pip install --user, you must add the user-level bin directory to your PATH environment variable in order to use pyheadspace. If you are using a Unix derivative (FreeBSD, GNU / Linux, OS X), you can achieve this by using export PATH="$HOME/.local/bin:$PATH" command.
  • Make sure you are using version 2.0.2 or above, otherwise many features might not work. After install check the version by running headspace --version

This tool is only meant for personal use. Do not use this for piracy!

โš™๏ธ Setup

Run and enter login credentials.

headspace login

๐Ÿš€ Usage

Download all packs at once

# Download all packs with each session of duration 15 minutes
headspace pack --all --duration 15

# Download all packs with session duration of 10 & 20 minutes
headspace pack --all --duration "[10,20]"

Exclude specific packs from downloading:

To exclude specific packs from downloading use --exclude option.
It expects location of text file for links of packs to exclude downloading. Every link should be on separate line.

links.txt:

https://my.headspace.com/packs/5
https://my.headspace.com/packs/6

command

headspace packs --all --exclude links.txt

This would download all packs except the ones in links.txt file

Downloading specific Headspace pack

headspace pack <URL> [Options]

It expects URL in format https://my.headspace.com/packs/<int>


BASIC USAGE

# Download with all session of duration 15 minutes
headspace pack https://my.headspace.com/packs/33 --duration 15 

# Download sessions of multiple duration
headspace pack https://my.headspace.com/packs/33 --duration "[20, 15, 10]"    

Options:

--id INTEGER         ID of video.
-d, --duration TEXT  Duration or list of duration
--no_meditation      Only download meditation session without techniques
                    videos.
--no_techniques      Only download techniques and not meditation sessions.
--out TEXT           Download directory
--all                Downloads all headspace packs.
-e, --exclude TEXT   Use with `--all` flag. Location of text file with links
                    of packs to exclude downloading. Every link should be
                    on separate line.
--help               Show this message and exit.

Download single session

headspace download <URL> [options]

It expects URL in format https://my.headspace.com/play/<int>


BASIC USAGE

$ headspace download https://my.headspace.com/play/520 --duration 15
# Download sessions of multiple durations
$ headspace download https://my.headspace.com/play/520 --duration "[15,20]"

Options:

--out TEXT           Download directory.
--id INTEGER         ID of the video. Not required if URL is provided.
-d, --duration       Duration or list of duration
--help               Show this message and exit.

Download everyday meditations

headspace everyday [OPTIONS]

How to get your user id?

  1. First goto https://www.headspace.com/login and login with your credentials
  2. Go to https://webviews.headspace.com/data and get the User ID

BASIC USAGE

# Downloads today's meditation
headspace everyday --userid <YOUR USER ID>

# Download everyday meditation of specific time period.
# DATE FORMAT: yyyy-mm-dd
headspace everyday --from 2021-03-01 --to 2021-03-20 --userid <YOUR USER ID>

Options

--userid TEXT
--from TEXT          Start download from specific date. DATE-FORMAT=>yyyy-
                    mm-dd
--to TEXT            Download till a specific date. DATE-FORMAT=>yyyy-mm-dd
-d, --duration TEXT  Duration or list of duration
--out TEXT           Download directory
--help               Show this message and exit.

If you encounter any issue or bug, open a new issue on github

pyheadspace's People

Contributors

yashrathi-git avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.