[totem-pl-parser/wip/hadess/videosite: 2/3] videosite: Move documentation to separate file
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser/wip/hadess/videosite: 2/3] videosite: Move documentation to separate file
- Date: Tue, 29 Sep 2020 11:21:44 +0000 (UTC)
commit c2e767a995a8ea2c65217922eec18ad1e49055af
Author: Bastien Nocera <hadess hadess net>
Date: Tue Sep 29 13:10:44 2020 +0200
videosite: Move documentation to separate file
And update contents for latest changes.
plparse/README-videosite-script.md | 43 +++++++++++++++++++++++++++++++++++++
plparse/totem-pl-parser-videosite.c | 35 +-----------------------------
2 files changed, 44 insertions(+), 34 deletions(-)
---
diff --git a/plparse/README-videosite-script.md b/plparse/README-videosite-script.md
new file mode 100644
index 0000000..0934f3c
--- /dev/null
+++ b/plparse/README-videosite-script.md
@@ -0,0 +1,43 @@
+Video site parsing scripts
+--------------------------
+
+totem-pl-parser can "parse" pages from certain websites into a single
+video playback URL. This is particularly useful for websites which
+show a unique video on a web page, and use one-time URLs to prevent direct
+linking.
+
+This feature is implemented in a helper binary, which needs to be installed
+next to this README file, in totem-pl-parser's `libexec` directory, or
+in the directory pointed to by the `TOTEM_PL_PARSER_VIDEOSITE_SCRIPT`
+environment variable.
+
+totem-pl-parser used to ship such a script that used libquvi, but doesn't
+anymore. The first script (when sorted by lexicographic ordering) in the
+aforementioned directory will be used.
+
+The API to implement is straight-forward. For each URL that needs to
+be checked, the script will be called with the command-line arguments
+`--check --url` followed by the URL. The script should return the
+string `TRUE` if the script knows how to handle video pages from
+this site. This call should not making any network calls, and should
+be fast.
+
+If the video site is handled by the script, then the script can be
+called with `--url` followed by the URL. The script can return the
+strings `TOTEM_PL_PARSER_RESULT_ERROR` or
+`TOTEM_PL_PARSER_RESULT_UNHANDLED` to indicate an error (see the
+meaning of those values in the [totem-pl-parser API
documentation](https://developer.gnome.org/totem-pl-parser/stable/TotemPlParser.html#TotemPlParserResult)),
+or a list of `<key>=<value>` pairs separated by newlines characters (`\n`)
+The keys are listed as [metadata
fields](https://developer.gnome.org/totem-pl-parser/stable/TotemPlParser.html#TOTEM-PL-PARSER-FIELD-URI:CAPS)
+in the API documentation, such as:
+
+```
+url=https://www.videosite.com/unique-link-to.mp4
+title=Unique Link to MP4
+author=Well-known creator
+```
+
+Integrators should make sure that totem-pl-parser is shipped with at
+least one video site parser, in a separate package, such as a third-party parser
+that implements a compatible API as explained above. Do **NOT** ship
+third-party parsers in the same package as totem or totem-pl-parser itself.
\ No newline at end of file
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 13ffe17..4031440 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -30,40 +30,7 @@
#define SCRIPT_ENVVAR "TOTEM_PL_PARSER_VIDEOSITE_SCRIPT"
-/* totem-pl-parser can "parse" pages from certain websites into a single
- * video playback URL. This is particularly useful for websites which
- * show a unique video on a web page, and use one-time URLs to prevent direct
- * linking.
- *
- * This feature is implemented in a helper binary, either the one shipped
- * in totem-pl-parser (which uses libquvi), or the first non-hidden file in
- * the totem-pl-parser libexec directory, when sorted by lexicographic
- * ordering (through strcmp).
- *
- * The API to implement is straight-forward. For each URL that needs to
- * be checked, the script will be called with the command-line arguments
- * "--check --url" followed by the URL. The script should return the
- * string "TRUE" if the script knows how to handle video pages from
- * this site. This call should not making any network calls, and should
- * be fast.
- *
- * If the video site is handled by the script, then the script can be
- * called with "--url" followed by the URL. The script can return the
- * strings "TOTEM_PL_PARSER_RESULT_ERROR" or
- * "TOTEM_PL_PARSER_RESULT_UNHANDLED" to indicate an error (see the
- * meaning of those values in the totem-pl-parser API documentation), or
- * a list of "<key>=<value>" pairs separated by newlines characters (\n)
- * The keys are "metadata fields" in the API documentation, such as:
- * url=https://www.videosite.com/unique-link-to.mp4
- * title=Unique Link to MP4
- * author=Well-known creator
- *
- * Integrators should make sure that totem-pl-parser is shipped with at
- * least one video site parser, either the quvi one offered by
- * totem-pl-parser itself, or, in a separate package, a third-party parser
- * that implements a compatible API as explained above. Do *NOT* ship
- * third-party parsers in the same package as totem itself.
- */
+/* See README-videosite-script.md */
static char *
find_helper_script (void)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]