MarcelRobitaille / bbyen

Bring Back YouTube Email Notifications! YouTube upload email notification replacement
MIT License
10 stars 0 forks source link

Found some bugs #1

Closed kagejohn closed 4 years ago

kagejohn commented 4 years ago

Only looks at videos that have been a livestream and skips all other videos: https://github.com/MarcelRobitaille/bbyen/blob/0b3797024750644611bde8e00bd7101c6b08dae8/src/videos.js#L69

If i remove the above if then i get problems with this: https://github.com/MarcelRobitaille/bbyen/blob/0b3797024750644611bde8e00bd7101c6b08dae8/src/videos.js#L99 Because none livestream videos do not have that property/value.

I don't know if it is because i am using Gmail to send emails but i get the error 421 and 454 long before i get 550 and when i did get 550 i didn't get it at the same time as "err.code === 'EMESSAGE'"

I don't know if this was a setting that should have been set in the config file but this line doesn't work at all: https://github.com/MarcelRobitaille/bbyen/blob/0b3797024750644611bde8e00bd7101c6b08dae8/src/lib/logger.js#L14

MarcelRobitaille commented 4 years ago

Haha, you caught me in the middle of trying to get livestreaming to work properly. I didn't think I pushed any of it yet, sorry.

You are right, I intended line 69 to be inverted.

What exactly happens at line 99? Even if details.liveStreamingDetails isn't present in the object, it won't error, you'll just get undefined.

When you get 421 / 454, do you get that for every request after that too?

MarcelRobitaille commented 4 years ago

454 looks like a non standard status code. I'm seeing "Your email system must authenticate" and "Session Not Found (RTSP)".

Can you send any emails at all?

kagejohn commented 4 years ago

What exactly happens at line 99? Even if details.liveStreamingDetails isn't present in the object, it won't error, you'll just get undefined.

It gave an error i didn't write it down. I just changed back the change i made to fix it and now it doesn't give any errors so i have no idea.

When you get 421 / 454, do you get that for every request after that too?

I first get one 421 and then 454 for every email after that.

Can you send any emails at all?

I sent 1103 before i hit my daily limit. You can read about it here: https://serverfault.com/questions/543007/google-smtp-error-454-4-7-0-too-many-login-attempts-please-try-again-later

Because of the 500 daily limit from Gmail, i have changed to my own domain where i can send more.

MarcelRobitaille commented 4 years ago

Can you check if the livestreaming is handled correctly now?

Glad you have a solution. I think the project should still handle 421 and 454 correctly. I will add that.

I cannot reproduce the logging issue.

Next time, could you please open one issue per, well, issue?

Glad to see that someone is using this project. How have you been liking it (besides these issues)?

kagejohn commented 4 years ago

Can you check if the livestreaming is handled correctly now?

It sends Emails about past live streams and skips all other videos.

I cannot reproduce the logging issue.

bbyen\src\lib\logger.js:14 level: config.logging.level, ^

TypeError: Cannot read property 'level' of undefined at createLogger (E:\Bring Back YouTube Email Notifications\bbyen\src\lib\logger.js:14:24) at Object. (E:\Bring Back YouTube Email Notifications\bbyen\src\google\auth\index.js:9:43) at Module._compile (internal/modules/cjs/loader.js:1085:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:791:14) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (E:\Bring Back YouTube Email Notifications\bbyen\src\index.js:6:19) at Module._compile (internal/modules/cjs/loader.js:1085:30)

Glad to see that someone is using this project. How have you been liking it (besides these issues)?

I am not a fan of manual work so i like it a lot.

MarcelRobitaille commented 4 years ago

Can you share your config.json please? (don't forget to remove your passwords and such). The logging issue seems to be a problem with the config format.

It sends Emails about past live streams and skips all other videos.

You're right. Definitely bad logic here. Why am I still getting normal videos? I'll try to fix it.

Want to try the latest commit?

kagejohn commented 4 years ago

Can you share your config.json please?

{ "email": { "host": "", "port": 465, "secure": true, "auth": { "user": "", "pass": "" }, "sendingContact": "\"BBYEN\" ", "destination": "" }, "database": { "filename": "database.sqlite" }, "timers": { "subscriptions": "3 days", "videos": "10 minutes" }, "kickoff": { "subscriptions": true, "videos": true } }

You're right. Definitely bad logic here. Why am I still getting normal videos? I'll try to fix it.

Maybe you are getting "Premiered" videos, they show up as a "livestream" so that people can see it together for the first time.

Want to try the latest commit?

https://github.com/MarcelRobitaille/bbyen/commit/6fd01786e3fb930d1896f576531bc57203304598 Seems to have fixed it.

But now live streams have the time shown like this in the Email: undefined:undefined:undefined

MarcelRobitaille commented 4 years ago

Your config.json is missing the logging key. That is why you are getting the error. It should look like this:

{
    "email": {
        "host": "",
        "port": 465,
        "secure": true,
        "auth": {
            "user": "",
            "pass": ""
        },
        "sendingContact": "\"BBYEN\" ",
        "destination": ""
    },
    "database": {
        "filename": "database.sqlite"
    },
    "timers": {
        "subscriptions": "3 days",
        "videos": "10 minutes"
    },
    "kickoff": {
        "subscriptions": true,
        "videos": true
    },
    "logging": {
        "level": "info"
    }
}

That is my fault. I did not update config.example.json after adding loggin.

I have definitely been getting more that premieres.

But now live streams have the time shown like this in the Email:

Are these livestreams currently live? Or are they passed live streams?

kagejohn commented 4 years ago

Are these livestreams currently live? Or are they passed live streams?

"Premiered Apr 11, 2020"

MarcelRobitaille commented 4 years ago

Ok so very much not live. I'll look into it.

MarcelRobitaille commented 4 years ago

Can you reproduce on the latest commit? None of my subs are uploading premieres right now so I haven't caught it in the wild.

MarcelRobitaille commented 4 years ago

I just went and found a premiere and it is working fine (time shown correctly and with a red background to indicate that it was a livestream or premere). I am closing this for now. Feel free to open again if you can still reproduce.