kelciour / movies2anki

Convert movies with subtitles to watch them with Anki. Inspired by subs2srs
GNU Affero General Public License v3.0
302 stars 28 forks source link

Don't show the error message if File → Switch Profile was used while generating mobile cards #28

Closed kelciour closed 4 months ago

pyropractic commented 4 months ago

Hello. I have problem recently occurred when creating a card for a phone through the Generate mobile cards button. What could be the problem? Thanks.

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.19045

Traceback (most recent call last): File "C:\Users\Ura\AppData\Roaming\Anki2\addons21\939347702\player.py ", line 1052, in update_media video_id = m.group(1) AttributeError: 'NoneType' object has no attribute 'group'

image

kelciour commented 4 months ago

Thanks for your feedback on the bug on AnkiWeb. I was going to update the addon over the weekend so that the addon would try to automatically fix this error using the Video or Audio field, or skip cards with this error and generate a report of which cards were ignored.

Most likely, the error is due to the fact that the Id field was accidentally edited manually, for example, it is empty.

To fix the error, you can either delete the deck and create it again, or search for cards in the browser using the following search line and manually fix the Id field by copying it from the Audio or Video field and removing the extension.

note:movies2anki_* Id:re:.* -"Id:re:^.*?\_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$"

It should look like this.

image

Or wait for the addon update until tomorrow.

pyropractic commented 4 months ago

I deleted all the video cards and still get this error. I will wait for the update and in the meantime I will prepare new cards for download. I tried to create a new profile and there was only a problem in the name of the last folder that had a space in the name. I have removed this gap and everything is working. The other folders above also have spaces and this does not cause an error. image

This is a great app. There are some ideas how I would like to improve this application, because I create flashcards from YouTube videos. I mark subtitles that include new words using this app (https://chromewebstore.google.com/detail/seek-subtitles-for-youtub/ghjmdgljbfiiaginabfnaopnocgafffb) then I go to the downloaded subtitles and form my own selected combined subtitles from several if necessary to understand the meaning. Then I translate the newly selected subtitles using ChatGpt and highlight new words with the addition of a translation of each word - including 2-3 words in my native language to understand more of the meaning of the words.

Perhaps my ideas will somehow help to further improve this application. There is also a good application that creates cards from selected subtitles on YouTube, it almost suits me, the only problem is that it displays videos from YouTube and I must have the Internet to view such cards. https://chromewebstore.google.com/detail/youtube2anki/boebbbjmbikafafhoelhdjeocceddngi

kelciour commented 4 months ago

That's strange. If there's no cards to process, the Generate Mobile Cards should do nothing. Maybe some cards were left behind and were not removed. Try to locate them by searching with the note type.

image

Anyway, the add-on was just updated and if you run it, either the notes will be fixed or the add-on will report note ids with the same error. If you use this line to search in the card browser, Anki should find these notes.

About the error on the screenshot, if it happens again, please paste the output from Copy Debug Info. The space in the name shouldn't be a problem. But I fixed a similar error recently and this error message might never appear after updating the add-on.

I'd be nice to add some support for ChatGPT and YouTube one day. Thank you for the ideas!

kelciour commented 4 months ago

I'm closing the original issue, it should be fixed now, but feel free to comment if something doesn't work as expected or create a new issue.

I don't mind new ideas, but aside from making small and quick changes, I don't think I'll have time to implement or do something about them anytime soon.