Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:23
    sashashura opened #3543
  • Sep 23 15:21

    FlexGet-Bot on main

    Automated ChangeLog update (compare)

  • Sep 23 15:21

    FlexGet-Bot on develop

    v3.3.30 Prepare v3.3.31.dev (compare)

  • Sep 23 15:21

    FlexGet-Bot on v3.3.30

    (compare)

  • Sep 23 15:21

    FlexGet-Bot on master

    Prepare v3.3.30.dev [fix] Aria2 works again via jso… v3.3.30 (compare)

  • Sep 23 13:21
    github-actions[bot] labeled #3423
  • Sep 23 13:21
    github-actions[bot] commented #3423
  • Sep 22 19:13

    FlexGet-Bot on main

    Automated ChangeLog update (compare)

  • Sep 22 19:13
    paranoidi commented #3515
  • Sep 22 19:12

    paranoidi on develop

    [fix] Aria2 works again via jso… (compare)

  • Sep 22 19:12
    paranoidi closed #3460
  • Sep 22 19:12
    paranoidi closed #3515
  • Sep 22 16:56

    gazpachoking on main

    docs: update Qualities (compare)

  • Sep 22 16:51

    gazpachoking on main

    docs: update Qualities (compare)

  • Sep 22 15:20

    FlexGet-Bot on main

    Automated ChangeLog update (compare)

  • Sep 22 15:19

    FlexGet-Bot on master

    Prepare v3.3.29.dev Add a helper to export current … Remove (really) old qualities w… and 2 more (compare)

  • Sep 22 15:19

    FlexGet-Bot on develop

    v3.3.29 Prepare v3.3.30.dev (compare)

  • Sep 22 15:19

    FlexGet-Bot on v3.3.29

    (compare)

  • Sep 22 01:51
    RyoLee synchronize #3515
  • Sep 21 23:47

    gazpachoking on main

    docs: update Qualities docs: update Qualities docs: update Qualities and 2 more (compare)

FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) Don't think so
gazpachoking (discord) One time events aren't normally in the config, what's the use case?
BrutuZ (discord) Would like to integrate Discord Timestamps (https://discord.com/developers/docs/resources/channel#embed-object-embed-structure)
BrutuZ (discord) That field isn't in the schema currently, so defining it in the config returns an error. I changed the schema locally as a simple string field, but if going for a PR validating would be nice
gazpachoking (discord) I guess I'm still not sure what this would do
gazpachoking (discord) What goes into the config that has a timestamp?
gazpachoking (discord) For notifications?
BrutuZ (discord) Yes
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) And it'll be a fixed date?
BrutuZ (discord) You pass it a date in ISO8601, Discord formats it
gazpachoking (discord) But, wouldn't you want the date to be 'now' and not some arbitrary date put into the config?
gazpachoking (discord) I think I'm missing something
BrutuZ (discord) There's a "now" already in the message time
BrutuZ (discord) This is a nice way to tell when the entry was uploaded for example
gazpachoking (discord) I'm still confused how it goes in the config though
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) Because it'll need to be dynamic, not static
BrutuZ (discord) Not if you have a field formatted as TimeDate

BrutuZ (discord) ```yaml
notify:
entries:
message: "New Entry: {{title_pretty|d(title)}}"
via:

      - discord:
          web_hook_url: XXXXXXXXXXX
          embeds:
            - color: 0xf15478
              author: 
                name: "{{artist}}"
              url: "{{url}}"
              title: "{{original_title|d(title_pretty)|d(title)|d}}"
              description: "{{title_jp|d}}"
              timestamp: "{{upload_date}}"
              image: {url: "{{cover}}"}
              fields:
                - name: "Tags"
                  value: "> {{tags|d([])|join('\\n> ')|title}}"
                  inline: False
                - name: Uploaded
                  value: "{{(now-upload_date)|string|re_replace(':\\d\\d\\.\\d{6}','')}} ago"
                  inline: True
                - name: Reason
                  value: "{{reason|d('Unknown')|re_replace('regexp .(.+?). matched field .(\\w+).*','\\\\2 - \\\\1')|replace('\\\\b','')|replace('[- ]?',' ')|replace('(?!-oh)','')|capitalize}}"
                  inline: True

```
https://cdn.discordapp.com/attachments/536690097496784906/975227795586310224/unknown.png

FlexGet Bot
@FlexGet-Bot
BrutuZ (discord) Hmm, domain_delay doesn't apply to Notifiers... Sound the rate-limits 🪦
FlexGet Bot
@FlexGet-Bot
BrutuZ (discord) Think I got a compromise validating the timestamp config on the notify call. Thoughts @gazpachoking ?
        for embed in config.get('embeds', []):
            ts = embed.get('timestamp')
            if ts:
                if isinstance(ts, str):
                    if ts.isdigit():
                        try:
                            ts = datetime.utcfromtimestamp(int(ts))
                        except ValueError:
                            logger.info(
                                f"Value provided for 'timestamp' ({embed['timestamp']}) "
                                f"is not a timestamp ({int(datetime.now().timestamp())})."
                            )
                    else:
                        try:
                            ts = isoparse(ts)
                            embed['timestamp'] = ts
                        except (ParserError, ValueError) as e:
                            logger.info(f"'timestamp' is in an invalid format: {e}")
                if not isinstance(ts, datetime):
                    embed.pop('timestamp', None)
                    logger.warning("'timestamp' is invalid, dropping it")
                else:
                    embed['timestamp'] = datetime.strftime(ts, r'%Y-%m-%dT%H:%M:%S%z')
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) @BrutuZ Oh, I gotcha, it's jinja
gazpachoking (discord) Well, the validation will never run on that, so that bit doesn't really matter. That bit only runs on startup, and ignores jinja fields because they wouldn't normally pass.
gazpachoking (discord) I think using dateutil is probably easier than doing parsing on your own
gazpachoking (discord) I also don't think it could ever actually be a datetime already, could it?
BrutuZ (discord) I am using it. isoparse is from dateuril
gazpachoking (discord) Oh, gotcha
gazpachoking (discord) I think it's possible that field ends up as a number though, if it comes from a timestamp
gazpachoking (discord) So str/float/int, but not datetime are the things that would need to be handled.
BrutuZ (discord) I'm not sure, felt like a possiblity at the time before realizing Jinja turns even Integers into strings
FlexGet Bot
@FlexGet-Bot
BrutuZ (discord) I tried setting it as int in a mock, became string even with the |int() filter, that's why I put the isdigit() instead of another isinstance for int
gazpachoking (discord) Depends on if native parsing is used
gazpachoking (discord) Not sure if it is in this case
gazpachoking (discord) Looks like it isn't at the moment
gazpachoking (discord) In any case, your solution seems reasonable
FlexGet Bot
@FlexGet-Bot
BrutuZ (discord) Will whip it in a PR then. Also added the TimedLimiter to prevent losing notifications to rate-limit 😛
FlexGet Bot
@FlexGet-Bot
BrutuZ (discord) Pre-commit GH action failed because black changed a completely unrelated file 😅
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) Probably the same file that's blocking our release task on master already
BrutuZ (discord) The odd thing is that when I ran black on that file manually it didn't change anything
BrutuZ (discord) Was going for a "make pre-commit happy" commit (even though pre-commit should be running locally already) just to pass the test, turns out I couldn't
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) Hmm. Maybe old version of black? I just ran it on that file then pushed the commit. Things should be better again on develop branch now.
gazpachoking (discord) It just wanted an extra newline somewhere.
gazpachoking (discord) You might need to pull or rebase from develop
gazpachoking (discord) Or, I could just click merge. Lemme double check it
BrutuZ (discord) Shouldn't be, my launch script install both requirements files with every update
gazpachoking (discord) No, it was nothing in your branch, the problem was on develop branch when you made your commit.
gazpachoking (discord) Develop was already failing
gazpachoking (discord) Made one comment on your PR, other than that it looks good
FlexGet Bot
@FlexGet-Bot
aidan (discord) Heyo, is it possible to get some 👀 on this PR? Flexget/Flexget#3415 It's pretty straight forward
FlexGet Bot
@FlexGet-Bot
gazpachoking (discord) @aidan Looks good, just had one comment