Skip to content

Commit

Permalink
Fix doc urls (#1178)
Browse files Browse the repository at this point in the history
* update http -> https in docs

* update napiprojekt url to https

* update napiprojekt cassettes

* update http -> https in comments

* add news
  • Loading branch information
getzze authored Oct 21, 2024
1 parent 1494927 commit 13e8588
Show file tree
Hide file tree
Showing 21 changed files with 905 additions and 491 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document presents general guidelines to make contributions easier.
## Translations

Contribution to translations can be made on [subliminal's transifex page](https://www.transifex.com/subliminal/subliminal/)
Subliminal is configured to work with [transifex-client](http://docs.transifex.com/client/)
Subliminal is configured to work with [transifex-client](https://docs.transifex.com/client/)

## Issues

Expand Down
1 change: 1 addition & 0 deletions changelog.d/1178.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use https instead of http
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://sphinx-doc.org/)
endif

# Internal variables.
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.https://sphinx-doc.org/
exit /b 1
)

Expand Down
18 changes: 9 additions & 9 deletions docs/user/how_it_works.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Scoring
Rating subtitles and comparing them is probably the most difficult part and this is where subliminal excels with its
powerful scoring algorithm.

Using `guessit <http://guessit.readthedocs.org>`_ and `enzyme <http://enzyme.readthedocs.org>`_, subliminal extracts
Using `guessit <https://guessit.readthedocs.org>`_ and `enzyme <https://enzyme.readthedocs.org>`_, subliminal extracts
properties of the video and match them with the properties of the subtitles found with the providers.

Equations in :mod:`subliminal.score` give a score to each property (called a match). The more matches the video and
Expand All @@ -40,13 +40,13 @@ Libraries
---------
Various libraries are used by subliminal and are key to its success:

* `guessit <http://guessit.readthedocs.org>`_ to guess information from filenames
* `enzyme <http://enzyme.readthedocs.org>`_ to detect embedded subtitles in videos and read other video metadata
* `babelfish <http://babelfish.readthedocs.org>`_ to work with languages
* `requests <http://docs.python-requests.org>`_ to make human readable HTTP requests
* `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup>`_ to parse HTML and XML
* `dogpile.cache <http://dogpilecache.readthedocs.org>`_ to cache intermediate search results
* `stevedore <http://docs.openstack.org/developer/stevedore/>`_ to manage the provider entry point
* `chardet <http://chardet.readthedocs.org>`_ to detect subtitles' encoding
* `guessit <https://guessit.readthedocs.org>`_ to guess information from filenames
* `enzyme <https://enzyme.readthedocs.org>`_ to detect embedded subtitles in videos and read other video metadata
* `babelfish <https://babelfish.readthedocs.org>`_ to work with languages
* `requests <https://requests.readthedocs.org/>`_ to make human readable HTTP requests
* `BeautifulSoup <https://www.crummy.com/software/BeautifulSoup/>`_ to parse HTML and XML
* `dogpile.cache <https://dogpilecache.readthedocs.org>`_ to cache intermediate search results
* `stevedore <https://docs.openstack.org/stevedore/latest/>`_ to manage the provider entry point
* `chardet <https://chardet.readthedocs.org>`_ to detect subtitles' encoding
* `srt <https://github.com/cdown/srt>`_ to validate downloaded SubRip subtitles
* `pysub2 <https://github.com/tkarabela/pysubs2>`_ to validate and convert downloaded subtitles to other formats.
4 changes: 2 additions & 2 deletions docs/user/provider_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ Expiration time should be :data:`~subliminal.cache.SHOW_EXPIRATION_TIME` for sho

Language
--------
To be able to handle various language codes, subliminal makes use of `babelfish <http://babelfish.readthedocs.org>`_
To be able to handle various language codes, subliminal makes use of `babelfish <https://babelfish.readthedocs.org>`_
Language and converters. You must set the attribute :attr:`~subliminal.providers.Provider.languages` with a set of
supported :class:`~babelfish.language.Language`.

If you cannot find a suitable converter for your provider, you can `make one of your own
<http://babelfish.readthedocs.org/en/latest/#custom-converters>`_.
<https://babelfish.readthedocs.org/en/latest/#custom-converters>`_.


Querying
Expand Down
6 changes: 3 additions & 3 deletions docs/user/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Download English subtitles::
only. Otherwise you will get banned from the providers for abuse due to too many requests. If subliminal didn't
find subtitles for an old video, it's unlikely it will find subtitles for that video ever anyway.

You can use a configuration file in the `TOML <https://toml.io/>`_ format with the ``--config/-c`` option. If no configuration file is
You can use a configuration file in the `TOML <https://toml.io/en/>`_ format with the ``--config/-c`` option. If no configuration file is
provided, it looks for a ``subliminal.toml`` file in the default configuration folder for the application. This folder is
`OS dependent <https://github.com/platformdirs/platformdirs>`_:
`OS dependent <https://github.com/tox-dev/platformdirs>`_:

- Linux: ``/home/<user>/.config/subliminal/subliminal.toml``
- MacOS: ``/Users/<user>/Library/Application Support/subliminal/subliminal.toml``
Expand Down Expand Up @@ -85,7 +85,7 @@ of this example, we're going to use a memory backend.

Choose a cache that fits your application and prefer persistent over volatile backends. The ``file`` backend is
usually a good choice.
See `dogpile.cache's documentation <http://dogpilecache.readthedocs.org>`_ for more details on backends.
See `dogpile.cache's documentation <https://dogpilecache.readthedocs.org>`_ for more details on backends.

Now that we're done with the basics, let's have some *real* fun.

Expand Down
2 changes: 1 addition & 1 deletion subliminal/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ruff: noqa: FBT001
"""Subliminal uses `click <http://click.pocoo.org>`_ to provide a powerful :abbr:`CLI (command-line interface)`."""
"""Subliminal uses `click <https://click.palletsprojects.com>`_ to provide a :abbr:`CLI (command-line interface)`."""

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion subliminal/providers/napiprojekt.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class NapiProjektProvider(Provider):
subtitle_class: ClassVar = NapiProjektSubtitle

required_hash: ClassVar = 'napiprojekt'
server_url: ClassVar[str] = 'http://napiprojekt.pl/unit_napisy/dl.php'
server_url: ClassVar[str] = 'https://napiprojekt.pl/unit_napisy/dl.php'

timeout: int
session: Session | None
Expand Down
4 changes: 2 additions & 2 deletions subliminal/providers/podnapisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def query(
if self.session is None:
raise NotInitializedProviderError

# set parameters, see http://www.podnapisi.net/forum/viewtopic.php?f=62&t=26164#p212652
# set parameters, see https://www.podnapisi.net/forum/viewtopic.php?f=62&t=26164#p212652
params: dict[str, Any] = {'keywords': keyword, 'language': str(language)}
is_episode = False
if season is not None and episode is not None:
Expand All @@ -162,7 +162,7 @@ def query(
for data in result['data']:
# read xml elements
pid = data['id']
# ignore duplicates, see http://www.podnapisi.net/forum/viewtopic.php?f=62&t=26164&start=10#p213321
# ignore duplicates, see https://www.podnapisi.net/forum/viewtopic.php?f=62&t=26164&start=10#p213321
if pid in pids:
logger.debug('Ignoring duplicate %r', pid)
continue
Expand Down
4 changes: 2 additions & 2 deletions subliminal/refiners/omdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def apikey(self, value: str) -> None:


def refine_episode(client: OMDBClient, video: Episode, *, force: bool = False, **kwargs: Any) -> None:
"""Refine an Episode by searching `OMDb API <http://omdbapi.com/>`_."""
"""Refine an Episode by searching `OMDb API <https://omdbapi.com/>`_."""
# exit if the information is complete
if not force and video.series_imdb_id and video.imdb_id:
logger.debug('No need to search, IMDB ids already exist for the video.')
Expand Down Expand Up @@ -246,7 +246,7 @@ def refine_episode(client: OMDBClient, video: Episode, *, force: bool = False, *


def refine_movie(client: OMDBClient, video: Movie, *, force: bool = False, **kwargs: Any) -> None:
"""Refine a Movie by searching `OMDb API <http://omdbapi.com/>`_."""
"""Refine a Movie by searching `OMDb API <https://omdbapi.com/>`_."""
# exit if the information is complete
if not force and video.imdb_id:
logger.debug('No need to search, IMDB ids already exist for the video.')
Expand Down
2 changes: 1 addition & 1 deletion subliminal/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.. note::
To avoid unnecessary dependency on `sympy <http://www.sympy.org/>`_ and boost subliminal's import time, the
To avoid unnecessary dependency on `sympy <https://www.sympy.org/>`_ and boost subliminal's import time, the
resulting scores are hardcoded here and manually updated when the set of equations change.
Available matches:
Expand Down
2 changes: 1 addition & 1 deletion subliminal/subtitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def get_subtitle_suffix(

def find_potential_encodings(language: Language) -> list[str]: # pragma: no cover
"""Find potential encodings given the language."""
# http://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages
# https://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages

if language.alpha3 == 'zho':
return ['cp936', 'gb2312', 'gbk', 'hz', 'iso2022_jp_2', 'cp950', 'big5hkscs', 'big5', 'gb18030', 'utf-16']
Expand Down
2 changes: 1 addition & 1 deletion subliminal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def creation_date(filepath: os.PathLike | str) -> float:
Try to get the date that a file was created, falling back to when it was
last modified if that isn't possible.
See http://stackoverflow.com/a/39501288/1709587 for explanation.
See https://stackoverflow.com/a/39501288/1709587 for explanation.
"""
# Use creation time (although it may not be correct)
if platform.system() == 'Windows':
Expand Down
16 changes: 7 additions & 9 deletions tests/cassettes/napiprojekt/test_download_subtitles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ interactions:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br, zstd
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- Subliminal/2.1
- Subliminal/2.2
method: GET
uri: http://napiprojekt.pl/unit_napisy/dl.php?v=dreambox&kolejka=false&nick=&pass=&napios=Linux&l=PL&f=6303e7ee6a835e9fcede9fb2fb00cb36&t=0ce4a
uri: https://napiprojekt.pl/unit_napisy/dl.php?v=dreambox&kolejka=false&nick=&pass=&napios=Linux&l=PL&f=6303e7ee6a835e9fcede9fb2fb00cb36&t=0ce4a
response:
body:
string: !!binary |
Expand Down Expand Up @@ -843,22 +843,20 @@ interactions:
- max-age=1296000
Connection:
- Keep-Alive
Content-Encoding:
- gzip
Content-Length:
- '22597'
Content-Type:
- text/html; charset=UTF-8
Date:
- Fri, 31 May 2024 13:00:16 GMT
- Thu, 17 Oct 2024 20:53:37 GMT
Expires:
- Sat, 15 Jun 2024 13:00:16 GMT
- Fri, 01 Nov 2024 20:53:37 GMT
Keep-Alive:
- timeout=5, max=1000
Server:
- Apache
Vary:
- Accept-Encoding
content-length:
- '46894'
status:
code: 200
message: OK
Expand Down
Loading

0 comments on commit 13e8588

Please sign in to comment.