yashrathi-git / headspace-cli

A complete command line interface for Headspace, enabling direct access to meditation sessions from the command line.

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HELP - PermissionError: [Errno 13] Permission denied

ric-r opened this issue · comments

I apologize if this is the wrong place to ask for help, please forgive me I'm new on this platform.
I proceded with the login using the bearer token and then i get this error for the e.g. daily meditation:

PermissionError: [Errno 13] Permission denied: 'The Movement of the Mind.mp3'

I also write the other messages that appears on the console as it appears different to the one shown in the main page here:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/user/.local/bin/headspace:8 in │
│ │
│ 5 from pyheadspace.main import cli │
│ 6 if name == 'main': │
│ 7 │ sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0]) │
│ ❱ 8 │ sys.exit(cli()) │
│ 9 │
│ │
│ /usr/lib/python3/dist-packages/click/core.py:1128 in call
│ │
│ 1125 │ │
│ 1126 │ def call(self, *args: t.Any, **kwargs: t.Any) -> t.Any: │
│ 1127 │ │ """Alias for :meth:main.""" │
│ ❱ 1128 │ │ return self.main(*args, **kwargs) │
│ 1129 │
│ 1130 │
│ 1131 class Command(BaseCommand): │
│ │
│ /usr/lib/python3/dist-packages/click/core.py:1053 in main │
│ │
│ 1050 │ │ try: │
│ 1051 │ │ │ try: │
│ 1052 │ │ │ │ with self.make_context(prog_name, args, **extra) as ctx: │
│ ❱ 1053 │ │ │ │ │ rv = self.invoke(ctx) │
│ 1054 │ │ │ │ │ if not standalone_mode: │
│ 1055 │ │ │ │ │ │ return rv │
│ 1056 │ │ │ │ │ # it's not safe to ctx.exit(rv) here! │
│ │
│ /usr/lib/python3/dist-packages/click/core.py:1659 in invoke │
│ │
│ 1656 │ │ │ │ super().invoke(ctx) │
│ 1657 │ │ │ │ sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) │
│ 1658 │ │ │ │ with sub_ctx: │
│ ❱ 1659 │ │ │ │ │ return _process_result(sub_ctx.command.invoke(sub_ctx)) │
│ 1660 │ │ │
│ 1661 │ │ # In chain mode we create the contexts step by step, but after the │
│ 1662 │ │ # base command has been invoked. Because at that point we do not │
│ │
│ /usr/lib/python3/dist-packages/click/core.py:1395 in invoke │
│ │
│ 1392 │ │ │ echo(style(message, fg="red"), err=True) │
│ 1393 │ │ │
│ 1394 │ │ if self.callback is not None: │
│ ❱ 1395 │ │ │ return ctx.invoke(self.callback, **ctx.params) │
│ 1396 │ │
│ 1397 │ def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]: │
│ 1398 │ │ """Return a list of completions for the incomplete value. Looks │
│ │
│ /usr/lib/python3/dist-packages/click/core.py:754 in invoke │
│ │
│ 751 │ │ │
│ 752 │ │ with augment_usage_errors(__self): │
│ 753 │ │ │ with ctx: │
│ ❱ 754 │ │ │ │ return __callback(*args, **kwargs) │
│ 755 │ │
│ 756 │ def forward( │
│ 757 │ │ __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B902 │
│ │
│ /home/user/.local/lib/python3.10/site-packages/pyheadspace/main.py:626 in everyday │
│ │
│ 623 │ │ signed_url = get_signed_url(response, duration=duration) │
│ 624 │ │ │
│ 625 │ │ for name, direct_url in signed_url.items(): │
│ ❱ 626 │ │ │ download(direct_url, name, filename=name, out=out) │
│ 627 │ │ _from += timedelta(days=1) │
│ 628 │
│ 629 │
│ │
│ /home/user/.local/lib/python3.10/site-packages/pyheadspace/main.py:355 in download │
│ │
│ 352 │ max_tries = 5 │
│ 353 │ while failed_tries <= max_tries: │
│ 354 │ │ downloaded_length = 0 │
│ ❱ 355 │ │ with open(filepath, "wb") as file: │
│ 356 │ │ │ for chunk in track( │
│ 357 │ │ │ │ media.iter_content(chunk_size=chunk_size), │
│ 358 │ │ │ │ description=f"[red]Downloading...[/red]", │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
PermissionError: [Errno 13] Permission denied: 'The Movement of the Mind.mp3'