hrenfroe / yahoo-groups-backup

A python script to backup the contents of private Yahoo! groups.
The Unlicense
3 stars 4 forks source link

assert '@' in data['authorName'] failed #7

Open Onigiri-Kun opened 4 years ago

Onigiri-Kun commented 4 years ago

Hello, In scaper.py, at line 130, the assertion failed. This is caused by the messages having an authorName field of 'noAuthor'. I just did the following to just manage to get by for now (lines 129 to 132 in the original code):

if '@' in stripped_name:
    #The following causes problems if authorName is '(no author)'
    #assert '@' in data['authorName']
    stripped_name = stripped_name.split('@', 1)[0].strip()
    if check_authorname == '(no author)':
        eprint("authorName is '(no author). Replacing with 'from'")
        check_authorname = stripped_name
        data['authorName'] = stripped_name + '@..'
    else:
        check_authorname = check_authorname.split('@', 1)[0].strip(

I am not familiar with the code base, so maybe there is something better to do in this case?

hrenfroe commented 4 years ago

I'm not familiar with the code base either ;) I just happened to be a user who ironed out some issues last year and wanted to share. Can you add a PR for that?