Subwinder

Latest version: v1.1.2

Safety actively analyzes 627248 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1.1

* (2dd147a37c24d06f808bab821a839f0ff7986fb6) Fixed a bug introduced from incorrectly checking the length of the pairs for `asw.search_subtitles(...)` and updated tests to prevent any regressions.

1.1.0

Breaking Changes

- (37) All the `.from_data(...)` constructors now just take the raw data instead of `filename` and `dirname` too
- (36) The ranking functions now take library objects instead of the raw data, so `rank_search_subtitles` now takes a list of `SearchResults` and `rank_guess_media` takes the new `GuessMediaResult`
- (47) `Media` and `MediaInfo`'s `filename` and `dirname` are both private now. They now include getters and setters if you want to take a look at the docs. This was done because they're assumed to be `pathlib.Path`s, but the user may want to pass in any pathlike value
- (42) `.report_move(...)` was renamed to `.report_media(...)` to match the media agnostic tone of the rest of the library

New Features

- (40) `ranking` module was made public since the different ranking functions make good fallbacks for custom ranking functions
- (41) Several endpoints dealing with subtitles related actions can now take `SubtitlesInfo` objects along with `SearchResult`s
- (43) `report_media` now raises a `ValueError` when it's used with a `SearchResult` that wasn't found using the filehash and size
- (34) `search_subtitles` and `guess_media` now have unranked variants that directly return a list of `SearchResult`s and `GuessMediaResult`s for each query respectively
- (45) `.search_subtitles(...)` can now take queries as a `zip` too which works well for giving the desired language codes
- (2f9ffdeea6510d955bf15fec9534997f65a0db46) `atomicwrites` is now included as an optional dependency to allow for saving subtitles atomically
- (2d670be62e03389de217e4bf66efe9e7d0fe7d0c) the library now aggressively checks for wrong types and tries to return information on the allowed types

Bugfixes

- (46) `.guess_media(...)` previously had some weird edge-cases that would throw an obscure error (searching for `""`, or something with no results like `"asdkfjldsflgskdmfkl"`). Now the library handles these cases and the ranked version returns `None` while the unranked variant gets `GuessMediaResult` with no data (full of `None` and empty `list`s)

Documentation

- (39) More advanced examples were added to show a more featureful quickstart and more robust searching

Misc.

- (93f6df3b2b5de8de9be9f7712260034c3d4729c7) Added a PR template
- (33) Releases are now automatically published to pypi when a new release tag is pushed to the repo

1.0.2

Bugfixes

* Fixed a bug where the `lang` module still tried passing in a string for the endpoint instead of a `subwinder._request.Endpoints` option. This would cause fetching the lang list to fail which means most of the endpoints would fail to work correctly.

1.0.1

Bugfixes

* `AuthSubwinder` bugs
* Fixed a bug where having `download_dir` set in`.download_subtitles(...)` will fail with a type error due to incorrect changes trying to use `pathlib.Path`s
* Fixed a bug where you incorrectly couldn't `.vote(...)` for subtitles with a `score` of 1

All bugs have had tests added/updated to ensure behavior doesn't regress.

1.0.0

The fabled 1.0 release. No this isn't close to the final version of the library, I'm saving 2.0 for having all the endpoints exposed that I'm planning on exposing (8). Instead this is more to signify that the library's API should be mostly stable and I wanted the chance to make some breaking changes early on if I could. So here goes

Features

* The docs are now tracked in the repo instead of using the GitHub wiki. This provides the ease of setup from not having to use some external site while allowing docs to be pinned to each version. If you want to read more about it you can check here (23)
* Documentation was added for the `utils` functions
* CI is now more extensive with unit testing run on all 3 major platforms (Windows, Mac, Linux). this has already helped to catch a platform-related bug before they made it into a release (4d7f1f5ac69b85e7f781115f44e76d6d1fb26083)
* On top of that more extensive tests are now run to catch bugs that popped up during the release
* Common classes are now exposed from the base module `from subwinder import AuthSubwinder, Subwinder, Media`
* Media had its default construct switched to what was `.from_file(...)`, with the old constructor now residing as `.from_parts(...)`
* Downloaded subtitles are now saved atomically thanks to `atomicwrites` to prevent weird partially saved subtitles behavior

Bugfixes

* `name_format` from `Authsubwinder`'s `.download_subtitles(...)` should now accept more formats as valid
* `ProtocolError`s raised by opensubtitles API should be caught and handled now. It's hard to test with how sporadic the behavior is though

Breaking Changes

* Both the `subwinder.media.Subtitles` class and corresponding `subwinder.hashers.md5_hash` function were removed since they are considered dead code till uploading subtitles has been worked on
* `Media`s constructor was changed to match the behavior of the old `.from_file(...)` classmethod and the old constructor was added as the `.from_parts(...)` classmethod
* The whole library always uses `pathlib.Path`s for any file paths or names. Externally everything can take a `str` or `Path` path, but it will always be stored and exposed as a `Path` now instead of a `str`
* Lots of internal restructuring
* Modules that were already private, but denoted wrong are now correctly private (`_constants`, `_ranking`, `_request`)
* Everything from the `base` and `auth` modules got moved into `core`
* `SearchResult` got moved into `info` since it better matches those classes
* `special_hash` was moved into `utils`

Future Work

So most of the current groundwork has been laid out for CI, so some more work to finish that up will be done. Past that it's just improving documentation, getting some users to try out the library, and implementing the rest of the desired endpoints.

0.5.1

So this release is the beginning or proper versioning and stability for the library. I gave up on proper versioning while the API was experiencing a lot of churn, but now that it's settled down I'll be doing proper versioning and release notes from here on out! If you want to play around with the current version it's available to [download from pypi :tada:](https://pypi.org/project/subwinder/)

Currently, the library supports some of what I consider the most common functionality in a nice ergonomic way (this is primarily searching and downloading which are demonstrated in the Quickstart). There's plenty of other functionality if you want to take a look in the wiki along with an outline of what endpoints are covered and what is still being worked on in 8. The main focus for work in the meantime will be on trying to improve quality of life before moving on to adding more features including, but not limited to:

* Adding some integration tests to test overall behavior
* Ideally this will test at least some of the code snippets included in the documentation. The hard part will be mocking out all the different API requests which will be painful, to say the least
* Actually catch server errors correctly
* Difficult to debug with how sporadic and infrequent the errors are
* Cache the downloads for github actions runs since currently the majority of the time is spent downloading dependencies
* Have formatting for `black` automatically push the changes to pull requests to reduce friction for new contributors
* Automatically handle pushing releases to pypi when a release tag is pushed

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.