From e0dc8fdd8cadab471b82eeab83e2acfaf5dfdd17 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Fri, 1 Dec 2017 23:09:35 +0100 Subject: [PATCH] Playback from new IPFS URL scheme - dweb:/ipfs/ --- CHANGELOG.md | 1 + README.md | 3 +-- asciinema/asciicast/__init__.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e04160..5d4388e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * toggling pause in `asciinema play` by Space * stepping through a recording one frame at a time with . (when playback paused) * new `asciinema cat ` command to dump full output of the recording +* playback from new IPFS URL scheme (`dweb:/ipfs/`) * lots of other bugfixes and improvements ## 1.4.0 (2017-04-11) diff --git a/README.md b/README.md index 5edfe64..6a9eba5 100644 --- a/README.md +++ b/README.md @@ -218,8 +218,7 @@ Playing from stdin: Playing from IPFS: - asciinema play ipfs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V - asciinema play fs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V + asciinema play dweb:/ipfs/QmNe7FsYaHc9SaDEAEXbaagAzNw9cH7YbzN4xV7jV1MCzK/ascii.cast Available options: diff --git a/asciinema/asciicast/__init__.py b/asciinema/asciicast/__init__.py index 84051de..cbc7351 100644 --- a/asciinema/asciicast/__init__.py +++ b/asciinema/asciicast/__init__.py @@ -39,6 +39,8 @@ def open_url(url): url = "https://gateway.ipfs.io/%s" % url[6:] elif url.startswith("fs:/"): url = "https://gateway.ipfs.io/%s" % url[4:] + elif url.startswith("dweb:/ipfs/"): + url = "https://gateway.ipfs.io/%s" % url[5:] if url.startswith("http:") or url.startswith("https:"): req = Request(url)