Commit Graph

110 Commits

Author SHA1 Message Date
Thomas 11b92d5896 Use the new format for settings.xml
* Convert settings.xml to the new format supported in Kodi 19
* Create help strings to guide the users

Note: the translation of the new help strings in German is missing.
2021-09-03 16:47:47 +00:00
Thomas 8dec0f316e Update code for python 3
Drop support of python 2 and make the code compatible with python 3 so that the add-on works on Kodi 19.

Update Kodistubs version in the CI and get rid of the python 2 actions.

Note: script.module.libtorrent is disabled because it will not be used on Matrix (and is not compatible).
It will be replaced by vfs.libtorrent[1] when ready.

[1]: https://framagit.org/thombet/vfs.libtorrent
2021-09-01 22:17:39 +00:00
Thomas Bétous b629ee43a6 Release 1.2.0 2021-05-19 19:22:26 +02:00
Thomas 6f3759a928 Use script.module.libtorrent to import libtorrent
In order to support more systems (especially the ones where the
libtorrent python bindings cannot be installed manually), the add-on
script.module.libtorrent is now used to import libtorrent.
2021-05-19 17:18:00 +00:00
Thomas Bétous 2dc6e8a29f Add German to the list of languages in the README 2021-05-14 13:13:17 +02:00
Thomas 9e79850eee Add German translation and fix encoding errors
While adding the German translation some encodings errors occurred due
to non-ASCII characters. Only these errors were fixed because a full
analysis of the strings will be performed when implementing support for
python3.
2021-05-11 20:42:50 +00:00
Thomas Bétous b1b8106275 Release 1.1.0 2021-04-30 22:15:33 +02:00
Thomas 7297f8cef0 Various small updates before releasing v1.1
* Remove empty tags in addon.xml and add a disclaimer
* Update the description of the add-on in addon.xml
* Move icon.png into the "resources" folder to match Kodi guidelines (a
  solid white background is added automatically by Kodi so the icon was
  modified with a white background to avoid unexpected display and to
  match Kodi guidelines)
* Improve the translation guidelines
* Add a missing dot in a localized string
2021-04-30 16:35:20 +00:00
Thomas 134d2ea974 Localize and translate into French the add-on
* Localize all the strings so that the whole add-on can be translated
  (menus, notifications, etc.)
* Translate all the strings into French
* Add advice for future translators in the contribution guidelines
* List the supported languages in the README and a link to the
  translation guidelines
* Rearrange the parts of the README to have the most used information at
  the top
2021-04-29 20:38:14 +00:00
Thomas Bétous 939f1f0ea5 Create a template for bug reports 2021-04-28 23:42:12 +02:00
Thomas afd8756b38 Use PeerTube mascot as icon in the notifications 2021-04-28 21:16:20 +00:00
Thomas cb1825c1f9 Notify the user when the service started
Display a notification when the PeerTube service started so that the
user is aware that the add-on can be used.
This notification will be useful especially on slow devices.

The notification can be disabled in the settings.
2021-04-28 21:02:24 +00:00
Thomas Bétous d87f3038d9 Fix an unreachable branch in the search function
The warning notification was never displayed because PeerTube class
always returned a value even if no videos matching the keywords were
found.
2021-04-28 22:49:40 +02:00
Thomas 17f602da1a Create a CI job to check strings.po files
The new "translation" job that will be available only when strings.po
files are modified.
It will use the msgcmp tool to check that the translation files use the
correct reference strings.

A new part is also added in the contribution guidelines to help future
translators to start up.

See merge request StCyr/plugin.video.peertube!21 for more information
2021-04-27 20:52:59 +00:00
Thomas 13186dc697 Improve the settings layout and translation
* Turn the name of the main category of the settings into a localized
  string
* Add separators to group settings per theme
* Make some settings name more explicit
* Translate the possible values of the settings video_filter and
  video_sort_method

See merge request StCyr/plugin.video.peertube!20 for more information
2021-04-27 20:24:24 +00:00
Thomas Bétous 50a886d8cd Fix bug when video name contains non-ascii symbols 2021-04-25 23:07:33 +02:00
Thomas Bétous cc09006bd3 Fix the "Select instance" item in the home page 2021-04-24 23:03:51 +02:00
Thomas 4f8af35035 Support live streams
Now the type of a video is defined when trying to play a video so that
live streams (.m3u8) are directly played by Kodi (no download required).

We are able to know if a video is live from the response of the "list"
REST API but it was decided to ignore this information in order to have
a single action to play video (whether it is live or not).
The goal was to keep the API of the add-on as simple as possible so that
externel users only have to call the add-on's API with the ID of a
video, without having to add the type of the video.
The information about the type of the video will anyway be available in
the response used to get the URL of a video so this solution does not
impact the performance.
2021-04-24 14:55:31 +00:00
DavidHenryThoreau ed39c453e9 Add French translation 2021-04-22 21:02:40 +00:00
Thomas 7a1a4e8485 Redesign the main file of the add-on
New features:
* Add the description of each video and each instance. The total number
  of local videos and users of an instance are also added to the
  description of the instance in Kodi.
* Add the total number of pages in the "Next page" item (+ fix the
  number of the current page)
* Display a notification when the download of the torrent starts (will
  help the user to know that something is going on, especially on slow
  machines)
* Support instance URL that are prefixed with "https://" in the settings

Internal changes:
* Create a smaller entry point file to match Kodi's best practices
  (main.py)
* Create a new main module (addon.py) containing only the code related
  to the add-on execution. The other lines of code were moved to the
  classes PeerTube or KodiUtils.
* KodiUtils is now a class and an instance of this class is made
  available to all the modules of the add-on to reuse easily its methods
  and attributes.
* Create helper functions in KodiUtils for creating items in Kodi UI
  easily

See merge request StCyr/plugin.video.peertube!17 for more information
2021-04-22 20:48:20 +00:00
Thomas 6f94e05398 Replace single quotes with double quotes
Make this a coding rule so that apostrophes don't need to be escaped in
strings (they are common in English and other languages).
2021-04-19 13:20:47 +00:00
Thomas 074be7aa12 Create a dedicated class to interact with PeerTube
The PeerTube class is responsible for providing methods to call easily
the PeerTube REST APIs.

Other changes:
* the video filter is now also used when searching videos
* in case of error when sending a request, the message from the response
  is displayed on the screen (even when listing the instances)
* all the debug messages are now prefixed with the name of the add-on
  directly in kodi_utils: it allows an easier usage of this function
  anywhere in the add-on
* first version of the design of the add-on added in contributing.md

See merge request StCyr/plugin.video.peertube!14 for more information
2021-04-19 13:04:57 +00:00
Thomas Bétous 142df05350 Release 1.0.1 2021-04-12 23:13:50 +02:00
Thomas 0efeb9ffdf Support videos when WebTorrent is disabled
The URL of the video is not stored in the same attribute of the response
if WebTorrent is enabled or not.
It caused a bug when trying to play a video which do not use WebTorrent.

Also create a "quality" job to run pylint automatically on merge
requests. The contributing guidelines are updated with this information
and the remaining pylint violations were fixed in the code.

See merge request StCyr/plugin.video.peertube!11 for more information
2021-04-11 21:51:35 +00:00
Thomas f138f2595a Create a CI job to release the add-on
The CI job will take care of all the steps to create a new release in
GitLab:
* creation of the tag
* create of the release object with the release notes
All the required information will be extracted from the addon.xml file.

A "pre-release" job is also added to validate the changes in addon.xml
before the actual release is done.

All these steps are explained in the contribution guidelines.

Finally the files TESTME.md and createaddon.sh are removed since the
installation steps are explained in the wiki and the archive of the
add-on is created automatically by GitLab in the release.

See merge request StCyr/plugin.video.peertube!12 for more information
2021-04-11 20:40:44 +00:00
Thomas c723ced0c6 Fix the selection of instances
When a new instance was selected from the list of instances, it had no
effect because the new instance URL was saved in an attribute that was
reset at the next call of the add-on.
Now when the user selects a new instance, the associated setting is
updated so that this value can be reused the next time the add-on is
called or started.

Also took this opportunity to refactor the access to the add-on's
settings: there are now wrapper methods in kodi_utils.py which
encapsulates the call to Kodi APIs to make the code simpler.

See merge request StCyr/plugin.video.peertube!10 for more information
2021-04-11 08:44:18 +00:00
Thomas Bétous a88a60376f Disable the 'delete_files' setting
This setting is not used so it is disabled until the feature
is implemented to avoid confusing the users.
2021-04-10 22:52:49 +02:00
Thomas 77ce68a637 Release 1.0.0
Update the major version because the external API to play videos
received non-backward compatible changes.
2021-04-08 22:05:12 +00:00
Thomas Bétous a86f2b8f09 Update the URL for libtorrent install
The short URL was pointing to the wrong wiki (the one in my fork)
2021-04-08 23:42:32 +02:00
Thomas 4346178db9 Guide the user when libtorrent cannot be imported
Libtorrent is required to play videos but its installation is still
manual so now a message is displayed when libtorrent could not be
imported instead of having a "service could not start" error at Kodi
startup.
The message contains a link to a page which explains how to install
libtorrent. It will be displayed when:
* the add-on starts
* the user selects a video to play (including when called externally)

Other additions:
* Create a kodi_utils module to centralize some calls to the Kodi API
* Add license information in the header of the files
* Ignore some files in Git (python cache and Mac OS system file)
2021-04-08 23:25:49 +02:00
Thomas 7a21bd92ac Allow playing videos only with the video ID
Now the "play_video" action can be called with the ID of the video (and
optionally the URL of the instance hosting the video) as parameter
instead of the full URL: it will allow other add-ons to call the add-on
to play videos since the full URL contains the resolution which is not
known.

It led to some refactoring and changes in the code:
* Only the instance and the id of a video is retrieved when browsing and
  listing videos which improves the performance a lot (the video URL and
  the resolution are defined only when the video is played)
* the "https://" prefix is now automatically added to the instances URL
  because the instance-related REST APIs use URLs without this prefix.
  It also simplifies the external API because the user does not have to
  provide this prefix.
  Consequently the prefix was removed from the default value of the
  selected instance in the settings: it simplifies the code but it
  generates a non-backward compatible change. The impact is limited
  because it can be easily fixed by resetting the settings to the
  default value and there are very few users currently.

Other changes:
 - manage errors when retrieving the information of a video
 - fix some PEP 8 errors
2021-04-08 23:16:39 +02:00
Thomas d14bf5b094 Release 0.3.2 2021-04-08 21:04:46 +00:00
Thomas d657480eab Browse only local videos by default
Use "local" instead of "all-local" by default because "all-local"
requires admin privileges

Other improvements:
* Replace urllib with requests to make the management of the HTTP
  requests simpler (better error handling and easier implementation of
  complex requests in the future)
* Refactor the functions used to build the HTTP request to improve
  maintainability (don't know if it makes sense to keep a single
  function for the "search" and the "list videos" request).
* Use "urlencode" to generate the Kodi URL using a dict to make it more
  generic.
* Create a function to log messages easily in Kodi's debug log. It will
  decrease the amount of duplicate code.
* Fix some errors reported by pylint with regards to PEP 8
2021-03-28 21:27:28 +00:00
Cyrille Bollu 3677924a60 Looks good. Thanks for your contribution :-)
Merge branch 'local_videos' into 'master'

Add a video_filter parameter to be able to browse only local

- when browsing ( and not searching ) it is possible to select
filter=local that will show only local video
- create dedicated method to build kodi and peertube api url
- bumped version to 0.3.1.1 to indicate this change
  - if selected upstream might want to change it to 0.3.2

See merge request StCyr/plugin.video.peertube!2
2020-03-12 09:40:49 +01:00
philippe lhardy 913e5fb905 add a video_filter parameter to be able to browse only local
- when browsing ( and not searching ) it is possible to select
filter=local that will show only local video
- create dedicated method to build kodi and peertube api url
- bumped version to 0.3.1.1 to indicate this change
  - if selected upstream might want to change it to 0.3.2
2018-11-24 17:31:09 +01:00
Cyrille Bollu f1307e142e Merge branch 'createaddon' into 'master'
Add TESTME.md information and needed tool to create a kodi package

See merge request StCyr/plugin.video.peertube!1
2018-11-23 14:10:05 +01:00
philippe lhardy b2c823b212 Add TESTME.md information and needed tool to create a kodi package
- add createaddon.sh script to create a package containing only needed artefacts
  - follow https://kodi.wiki/view/Add-on_structure
- add fanart.jpg
  - indicated as 'must be included' in https://kodi.wiki/view/Add-on_rules
2018-11-23 11:50:05 +01:00
Cyrille Bollu 4d0e5c76af Updated README.md to match latest development. 2018-09-19 09:22:30 +02:00
Cyrille Bollu 6cc556f6fa Fixed the msgid of the "preferred_resolution" setting 2018-08-02 17:45:06 +02:00
Cyrille Bollu 8ba2a7e781 Added a "Delete videos" setting (functionality not implemented yet) 2018-08-02 17:44:35 +02:00
Cyrille Bollu 3dd68c8ee2 Implemented the 'preferred video resolution' functionality:
Addon will use, by order of preferrence:
  1) The video matching exactly the user's preferrence
  2) A video with the best resolution that is lower than the user's preferrence
  3) The video with the lowest resolution that is higher than the user's preferrence
2018-08-02 17:36:58 +02:00
Cyrille Bollu 8b80a1fad7 Added a setting for 'preferred video resolution'
Functionality not yet implemented though
2018-08-02 16:58:07 +02:00
Cyrille Bollu b225a9f6f8
Updated README.me
Mention the libtorrent python bindings requirement, and the low quality of the videos downloaded
2018-08-01 12:24:07 +02:00
Famille Bollu 659c3ac6b5 Bumped to version 0.3.1 2018-07-31 22:49:22 +02:00
Famille Bollu 17352c6313 Added a test to make sure a 'search videos' request actually returned results 2018-07-31 22:36:48 +02:00
Famille Bollu e7bbc94b35 Must add the 'https://' scheme before data['host'] in select_instance 2018-07-31 22:09:32 +02:00
Famille Bollu 38bb4414c4 Fixed a but in main menu where menu entries were not called with the 'isFolder'
attribute set to True
2018-07-31 22:00:33 +02:00
Famille Bollu 3c3b04c528 This was not such a bright idea to name a variable 'item' 2018-07-31 21:46:16 +02:00
Cyrille Bollu 054c446354 Bumped to version 0.3.0 2018-07-31 16:52:45 +02:00
Cyrille Bollu a3dc2511a5 Implemented the 'Browse instances" functionality
Major refactoring
2018-07-31 16:50:22 +02:00