manolomartinez / greg

A command-line podcast aggregator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`TypeError: 'UnknownFrame' object is not iterable` when downloading specific podcast

Neo-Oli opened this issue · comments

commented

When downloading Cortex (https://www.relay.fm/cortex/feed) I get the following error, after the download is completed.

$ greg sync Cortex
Checking Cortex...
Downloading Cortex 49: Waiting for the End -- Cortex_049.mp3
/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py:616: UnknownFrameWarning: CTOC: Unknown frame
  warn("{0}: Unknown frame".format(frameid), UnknownFrameWarning)
/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py:616: UnknownFrameWarning: CHAP: Unknown frame
  warn("{0}: Unknown frame".format(frameid), UnknownFrameWarning)
/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/frames.py:109: DuplicateFrameWarning: CHAP: Duplicate frame; only the first instance is kept
  DuplicateFrameWarning)
/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py:711: FrameWarning:
CTOC: Ignoring incompatible frame
  FrameWarning)
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/bin/greg", line 11, in <module>
    sys.exit(main())
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/greg/parser.py", line 138,
in main
    function(vars(args))
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/greg/commands.py", line 176, in sync
    downloaded = feed.download_entry(entry)
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/greg/classes.py", line 331, in download_entry
    aux.tag(placeholders)
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/greg/aux_functions.py", line 198, in tag
    stagger.util.set_frames(podpath, {tag: metadata})
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/util.py", line 111, in set_frames
    tag.write(filename)
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py", line 655, in write
    tag_data = self.encode(size_hint=length)
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py", line 1012, in encode
    frames = self._prepare_frames()
  File "/data/data/com.termux/files/home/.virtualenvs/greg/venv/lib/python3.6/site-packages/stagger/tags.py", line 706, in _prepare_frames
    for frame in self._frames[frameid]:
TypeError: 'UnknownFrame' object is not iterable

It stoppes greg from completing the sync and it will try to download this podcast episode again during the next sync. As far as I can tell this happens only with that podcast. It used to work fine, so maybe there is a problem with the feed now. All my other podcast download normally (at least after I issue greg edit --downloadfrom now "Cortex"). This problem happened for the last two episodes.

I thing I have found the issue, there is a tag with

WOAF (Official audio file webpage): http://www.fipradio.fr/emissions/c-est-magnifip

and the : seems to be analyzed like an object...

I have made a custom download and retag script to handle the issue

@cbonnissent Could you share more details about this? I, too, am encountering this issue — in a different feed, and it doesn't seem to have a colon in the tags. And it breaks sync completely, so it is a major problem....

@n8willis, would you mind letting us know which feed is causing this behavior? @cbonnissent's comment is very old and they might, understandably, not be interested in this issue anymore.

Sorry I don't use anymore greg

Good luck with the issue :D

@n8willis, would you mind letting us know which feed is causing this behavior? @cbonnissent's comment is very old and they might, understandably, not be interested in this issue anymore.

In this case, I'm referring to https://badvoltage.org/feed/mp3/ (which does use the multiplication sign "×" in filenames, but also uses spaces; both potentially parsing concerns).

@cbonnissent I'm not asking you to work on the issue, but just saying what you did that solved it would go a long way towards helping other people.

In this case, I'm referring to https://badvoltage.org/feed/mp3/ (which does use the multiplication sign "×" in filenames, but also uses spaces; both potentially parsing concerns).

I have just tried adding and syncing this podcast, and there were no problems. Would you mind pasting here your error trace? Also, I made a couple of commits recently, just in case you've been using an older greg.

Did you tag it? If so, which tags? Also, which episode(s) did you try?

I did add a couple tags to the feed's section in greg.conf, but I just noticed greg didn't actually tag them. So I'll need to look into this a bit more.

Yes; as the original reporter's logs indicated, this seems to happen when calling stagger.

It doesn't look like stagger is, shall we say, being vigorously maintained these days, which is worrying in its own right.

Yeah, I chose stagger way back when because it was one of the only python3 options around; but of course now everything is 3, so we could perhaps give eyeD3 a try. It should be a straightforward drop-in replacement.

@n8willis, if you have time, could you please check whether this PR solves your issue?

Feel free to open again if needed.

Right; will put it through a workout this weekend -- just couldn't set aside the time yet.

(In general, I'm very much in favor of eyeD3 usage. Especially because I already use it in my wrapper scripts.)

Can you make this a new release on PyPI? Please? Or at least bump the numbering?

Because apparently pip checks the internal version-numbering and doesn't just install any old git+https:// ref ... unless the user is willing to throw a bunch of workarounds at it. Which is a path I definitely don't want to go down.

Besides, it has been ages since the last official release.

Sure, I'll do it by Monday.