Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quality string option not working as intended #288

Open
TaleWatcher opened this issue Oct 21, 2023 · 0 comments
Open

quality string option not working as intended #288

TaleWatcher opened this issue Oct 21, 2023 · 0 comments

Comments

@TaleWatcher
Copy link

Example

Right now when I do animdl stream -q "720/480/1080" "animepahe:jujutsu kaisen 2" the first option is 360p
image

Expected behavior

The quality string 720/480/1080 sorts stream selection list in that order (At least that's how i remember it working) so the first options should be a 720p stream

Actual behavior

The stream select list includes only streams of quality 720 and lower and are not sorted
Also there's a print statement that shouldn't be there

print(portion, candidates)

As far as I can tell its a problem with this function

def iter_fulfilling_streams(

When I put a breakpoint in this function
def filter_quality(

Then do pp streams

[{'quality': 360,
  'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
 {'quality': 720,
  'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
 {'quality': 1080,
  'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/64e07450d6d69e096c119be6c2be20459cdf05fc330b2f9fea2d3b3b049141be?file=AnimePahe_Jujutsu_Kaisen_-_34_1080p_SubsPlease.mp4&token=z8GCCNrNtQ8kRvxfBC5Fhg&expires=1697900942'},
 {'quality': 360,
  'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
 {'quality': 720,
  'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
 {'quality': 1080,
  'stream_url': 'https://na-12.files.nextcdn.org/get/12/06/985f82235886f6b6486922308d62e7622c12a40bb02f218ba0c627fc6c78ab3a?file=AnimePahe_Jujutsu_Kaisen_-_34_1080p_AV1_SubsPlease.mp4&token=x0lS3NATJxuNAK8LQhpUmA&expires=1697900946'},
 {'quality': 360,
  'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
 {'quality': 720,
  'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'},
 {'quality': 1080,
  'stream_url': 'https://eu-99.files.nextcdn.org/get/99/01/3b32c4fd898559ed8a9f748e6c557e0cc06e823ade705589eb501ae3aa0affe1?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_1080p_Yameii.mp4&token=nC4D__vA2pn-oJnS5gwK6A&expires=1697900952'}]

Then do pp [i for i in iter_fulfilling_streams(streams, quality_string)]

[('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}]),
 ('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}]),
 ('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}]),
 ('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}]),
 ('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}]),
 ('720',
  [{'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/6abb00c964d98e73a6186b0e5daa4d59bd3af74732de9bcb6c3e000d7cbe0efb?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_SubsPlease.mp4&token=LDQI7xGLfMvJTt-ZqWKzAg&expires=1697900939'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/428549c2d96cef84e45c8cfef7de3b95e8c09ef8f99945a0e97f9b4875d61575?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_SubsPlease.mp4&token=75nmWRK3OQ4R_rbl__qmlA&expires=1697900940'},
   {'quality': 360,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/79114d65fcdc3a022bdb4c25f93112273d7a17c4039d3a40da2027ec40fa04af?file=AnimePahe_Jujutsu_Kaisen_-_34_360p_AV1_SubsPlease.mp4&token=1__LXqtTme102aIhKJNqOA&expires=1697900943'},
   {'quality': 720,
    'stream_url': 'https://eu-12.files.nextcdn.org/get/12/06/ec77e98fd29b6179844af0d20994876029a88da9f17b7cd9af691574af8d72a4?file=AnimePahe_Jujutsu_Kaisen_-_34_720p_AV1_SubsPlease.mp4&token=bWifvgIXOnE4fJ6eaoOMzw&expires=1697900944'},
   {'quality': 360,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/aff6740d8b7ac2f8648bd106ffc39e5d27e677cf48761de9b6899c5b0a6a3e99?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_360p_Yameii.mp4&token=dpwvfxPL03HnP-GvtfIvcA&expires=1697900949'},
   {'quality': 720,
    'stream_url': 'https://na-99.files.nextcdn.org/get/99/01/b3fb606a2a0b1037419cef4ffbba419a5c1dfe72dc9d4b5a5a5592a1ec7ee39b?file=AnimePahe_Jujutsu_Kaisen_Eng_Dub_-_34_720p_Yameii.mp4&token=dUgVqQ1D_NEa6hIDlUMQfw&expires=1697900951'}])]

Hopefully you find this useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant