Skip to content

[add] Add Telegram Input Plugin#2861

Merged
liiight merged 7 commits intoFlexget:developfrom
soloam:telegram_input
Mar 14, 2021
Merged

[add] Add Telegram Input Plugin#2861
liiight merged 7 commits intoFlexget:developfrom
soloam:telegram_input

Conversation

@soloam
Copy link
Copy Markdown
Contributor

@soloam soloam commented Feb 19, 2021

Motivation for changes:

Add the ability to input entries from a telegram chat

Detailed changes:

  • Created telegram_input plugin

Config usage if relevant (new plugin or updated schema):

secrets.yml

telegram:
  token: "<<my token>>"
  from: [{username: "<< MyUser Name >>" }]

config.yml

variables: secrets.yml

tasks: 

  #Task To add a Movie to the Queue
  Telegram_Add_Movie:
    disable:
      - remember_rejected
      - seen
      - retry_failed
      - seen_info_hash

    imdb_lookup: yes
    
    from_telegram:
      token: "{? telegram.token ?}"
      only_new: yes
      types:
        - "private"
        - "group"
      whitelist: "{? telegram.from ?}"
      entry:
        title: download (?:movie )?(.*)

      require_field:
        - imdb_name
        - imdb_id

    accept_all: yes

    list_add: 
      - movie_list: download_movie

    notify:
      entries:
        message: |+
          Ok, i'll download {{imdb_name}}
          [Imágem]({{(tvdb_posters|d|first )|d(imdb_photo)|d|replace("_", "%5F")}})
        via:
          - telegram:
              bot_token: "{? telegram.token ?}"
              parse_mode: markdown
              recipients: "{? telegram.from ?}"

  #Task to Run Downloads (Last we can clean the update)
  Telegram_Run_Task:
    disable:
      - remember_rejected
      - seen
      - retry_failed
      - seen_info_hash
    
    from_telegram:
      token: "{? telegram.token ?}"
      only_new: yes
      types:
        - "private"
        - "group"
      whitelist: "{? telegram.from ?}"
      entry:
        title: ^([d|D]ownload [m|M]ovies)$

    accept_all: yes

    run_task:
      when: accepted
      task: Download_Movies

    notify:
      task:
        message: |+
          Download Task Started
        via:
          - telegram:
              bot_token: "{? telegram.token ?}"
              parse_mode: markdown
              recipients: "{? telegram.from ?}"


  Download_Movies:
    discover:
      interval: 1 minute
      what:
        - movie_list: download_movie
      from:
        - flexget_archive: [teste]


Log and/or tests output (preferably both):

image

(flexget-dev) $ flexget --debug execute --task Telegram*
2021-02-19 16:49:37 DEBUG    manager                       Figuring out config load paths
2021-02-19 16:49:37 DEBUG    manager                       Adding virtualenv path
2021-02-19 16:49:37 DEBUG    manager                       Found config: /home/Name/flexget/flexget-dev/config.yml
2021-02-19 16:49:37 DEBUG    manager                       Config file /home/Name/flexget/flexget-dev/config.yml selected
2021-02-19 16:49:37 DEBUG    manager                       sys.defaultencoding: utf-8
2021-02-19 16:49:37 DEBUG    manager                       sys.getfilesystemencoding: utf-8
2021-02-19 16:49:37 DEBUG    manager                       flexget detected io encoding: utf-8
2021-02-19 16:49:37 DEBUG    manager                       os.path.supports_unicode_filenames: False
2021-02-19 16:49:37 DEBUG    plugin                        Trying to load plugins from: ['/home/Name/flexget/flexget-dev/plugins', '/home/Name/flexget/flexget-dev/flexget/plugins']
2021-02-19 16:49:37 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2021-02-19 16:49:37 DEBUG    plugin                        Trying to load components from: ['/home/Name/flexget/flexget-dev/components', '/home/Name/flexget/flexget-dev/flexget/components']
2021-02-19 16:49:38 DEBUG    plugin                        Plugins took 0.91 seconds to load. 307 plugins in registry.
2021-02-19 16:49:38 DEBUG    manager                       Connecting to: sqlite:////home/Name/flexget/flexget-dev/db-config.sqlite
2021-02-19 16:49:38 DEBUG    manager                       config_name: config
2021-02-19 16:49:38 DEBUG    manager                       config_base: /home/Name/flexget/flexget-dev
2021-02-19 16:49:38 DEBUG    manager                       New config data loaded.
2021-02-19 16:49:38 DEBUG    schema                        updating flexget version 3.1.103 in db
2021-02-19 16:49:38 DEBUG    parsing                       setting default movie parser to internal. (options: {'internal': <flexget.components.parsing.parsers.parser_internal.ParserInternal object at 0x7f651b8b2ac8>, 'guessit': <flexget.components.parsing.parsers.parser_guessit.ParserGuessit object at 0x7f651b8b2b38>})
2021-02-19 16:49:38 DEBUG    parsing                       setting default series parser to internal. (options: {'internal': <flexget.components.parsing.parsers.parser_internal.ParserInternal object at 0x7f651b8b2ac8>, 'guessit': <flexget.components.parsing.parsers.parser_guessit.ParserGuessit object at 0x7f651b8b2b38>})
2021-02-19 16:49:38 DEBUG    cron_env                      Encoding utf-8 stored
2021-02-19 16:49:38 DEBUG    util.simple_persistence                 setting key terminal_encoding value 'utf-8'
2021-02-19 16:49:38 DEBUG    task_queue                    task queue shutdown requested
2021-02-19 16:49:38 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2021-02-19 16:49:38 INFO     ipc.rpyc                      server started on [127.0.0.1]:42099
2021-02-19 16:49:38 DEBUG    task          Telegram_Add_Movie executing Telegram_Add_Movie
2021-02-19 16:49:38 DEBUG    disable       Telegram_Add_Movie Disabled plugins: seen_info_hash, retry_failed, remember_rejected, seen
2021-02-19 16:49:38 DEBUG    utils.requests Telegram_Add_Movie GETing URL https://api.telegram.org/<< token >>/getUpdates?offset=266474627 with args () and kwargs {'timeout': 60, 'allow_redirects': True}
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie Income message: {'update_id': 266474627, 'message': {'message_id': 25, 'from': {'id': << id >>, 'is_bot': False, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'language_code': 'en'}, 'chat': {'id': << id >>, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'type': 'private'}, 'date': 1613749607, 'text': 'download the matrix'}}
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie WhiteListing: Username << username >>
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie Added entry <Entry(title=the matrix,state=undecided)>
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie Income message: {'update_id': 266474628, 'message': {'message_id': 26, 'from': {'id': << id >>, 'is_bot': False, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'language_code': 'en'}, 'chat': {'id': << id >>, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'type': 'private'}, 'date': 1613750068, 'text': 'Download Movies'}}
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie WhiteListing: Username << username >>
2021-02-19 16:49:38 DEBUG    telegram_input Telegram_Add_Movie Ignored entry, not match on field title: <Entry(title=Download Movies,state=undecided)>
2021-02-19 16:49:38 DEBUG    backlog       Telegram_Add_Movie 0 entries purged from backlog
2021-02-19 16:49:38 VERBOSE  details       Telegram_Add_Movie Produced 1 entries.
2021-02-19 16:49:38 VERBOSE  task          Telegram_Add_Movie ACCEPTED: `the matrix` by accept_all plugin
2021-02-19 16:49:38 DEBUG    urlrewriter   Telegram_Add_Movie Checking 1 entries
2021-02-19 16:49:38 VERBOSE  details       Telegram_Add_Movie Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2021-02-19 16:49:38 VERBOSE  list_add      Telegram_Add_Movie adding accepted entries into movie_list - download_movie
2021-02-19 16:49:38 DEBUG    imdb_lookup   Telegram_Add_Movie lookup for the matrix
2021-02-19 16:49:38 DEBUG    imdb.db       Telegram_Add_Movie movie `The Matrix` age 22 expires in 112 days
2021-02-19 16:49:38 DEBUG    movie_list    Telegram_Add_Movie trying to match movie based off id imdb_id: tt0133093
2021-02-19 16:49:38 DEBUG    movie_list    Telegram_Add_Movie found movie <MovieListMovie title=The Matrix,year=1999,list_id=1>
2021-02-19 16:49:38 DEBUG    movie_list    Telegram_Add_Movie adding entry <Entry(title=the matrix,state=accepted)>
2021-02-19 16:49:38 DEBUG    util.simple_persistence Telegram_Add_Movie Flushing simple persistence for task Telegram_Add_Movie to db.
2021-02-19 16:49:38 DEBUG    task          Telegram_Run_Task executing Telegram_Run_Task
2021-02-19 16:49:38 DEBUG    disable       Telegram_Run_Task Disabled plugins: seen_info_hash, retry_failed, remember_rejected, seen
2021-02-19 16:49:38 DEBUG    utils.requests Telegram_Run_Task GETing URL https://api.telegram.org/<< token >>/getUpdates with args () and kwargs {'timeout': 60, 'allow_redirects': True}
2021-02-19 16:49:39 DEBUG    util.simple_persistence Telegram_Run_Task setting key << token >>_update_id value 266474627
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task Income message: {'update_id': 266474627, 'message': {'message_id': 25, 'from': {'id': << id >>, 'is_bot': False, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'language_code': 'en'}, 'chat': {'id': << id >>, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'type': 'private'}, 'date': 1613749607, 'text': 'download the matrix'}}
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task WhiteListing: Username << username >>
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task Ignored entry, not match on field title: <Entry(title=download the matrix,state=undecided)>
2021-02-19 16:49:39 DEBUG    util.simple_persistence Telegram_Run_Task setting key << token >>_update_id value 266474628
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task Income message: {'update_id': 266474628, 'message': {'message_id': 26, 'from': {'id': << id >>, 'is_bot': False, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'language_code': 'en'}, 'chat': {'id': << id >>, 'first_name': 'Name', 'last_name': 'Last', 'username': '<< username >>', 'type': 'private'}, 'date': 1613750068, 'text': 'Download Movies'}}
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task WhiteListing: Username << username >>
2021-02-19 16:49:39 DEBUG    telegram_input Telegram_Run_Task Added entry <Entry(title=Download Movies,state=undecided)>
2021-02-19 16:49:39 DEBUG    backlog       Telegram_Run_Task 0 entries purged from backlog
2021-02-19 16:49:39 VERBOSE  details       Telegram_Run_Task Produced 1 entries.
2021-02-19 16:49:39 VERBOSE  task          Telegram_Run_Task ACCEPTED: `Download Movies` by accept_all plugin
2021-02-19 16:49:39 DEBUG    urlrewriter   Telegram_Run_Task Checking 1 entries
2021-02-19 16:49:39 VERBOSE  details       Telegram_Run_Task Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2021-02-19 16:49:39 WARNING  task          Telegram_Run_Task Task doesn't have any output plugins, you should add (at least) one!
2021-02-19 16:49:39 INFO     run_task      Telegram_Run_Task Scheduling tasks ['Download_Movies'] to run
2021-02-19 16:49:39 DEBUG    util.simple_persistence Telegram_Run_Task Flushing simple persistence for task Telegram_Run_Task to db.
2021-02-19 16:49:39 DEBUG    task          Download_Movies executing Download_Movies
2021-02-19 16:49:39 DEBUG    status        Download_Movies Adding new task Download_Movies
2021-02-19 16:49:39 VERBOSE  discover      Download_Movies Discovering 1 titles ...
2021-02-19 16:49:39 DEBUG    discover      Download_Movies The Matrix (1999) -> No previous run recorded
2021-02-19 16:49:39 DEBUG    est_released  Download_Movies The Matrix (1999)
2021-02-19 16:49:39 DEBUG    est_movies_bluray Download_Movies Searching Blu-ray.com for release date of The Matrix (1999)
2021-02-19 16:49:39 DEBUG    api_bluray    Download_Movies Movie The Matrix 4K (1999) information restored from cache.
2021-02-19 16:49:39 DEBUG    est_movies_bluray Download_Movies received release date: 2018-05-22
2021-02-19 16:49:39 DEBUG    discover      Download_Movies The Matrix (1999) has been released at 2018-05-22 00:00:00
2021-02-19 16:49:39 VERBOSE  discover      Download_Movies Searching for `The Matrix (1999)` with plugin `flexget_archive` (1 of 1)
2021-02-19 16:49:39 DEBUG    archive       Download_Movies looking for `The Matrix 1999` config: ['teste']
2021-02-19 16:49:39 DEBUG    archive       Download_Movies found 0 entries
2021-02-19 16:49:39 DEBUG    discover      Download_Movies No results from flexget_archive
2021-02-19 16:49:39 VERBOSE  discover      Download_Movies No search results for `The Matrix (1999)`
2021-02-19 16:49:39 DEBUG    backlog       Download_Movies 0 entries purged from backlog
2021-02-19 16:49:39 VERBOSE  details       Download_Movies Task didn't produce any entries.
2021-02-19 16:49:39 WARNING  task          Download_Movies Task does not have any filter plugins to accept entries. You need at least one to accept the entries you  want.
2021-02-19 16:49:39 DEBUG    urlrewriter   Download_Movies Checking 0 entries
2021-02-19 16:49:39 VERBOSE  details       Download_Movies Summary - Accepted: 0 (Rejected: 0 Undecided: 0 Failed: 0)
2021-02-19 16:49:39 WARNING  task          Download_Movies Task doesn't have any output plugins, you should add (at least) one!
2021-02-19 16:49:39 DEBUG    util.simple_persistence Download_Movies Flushing simple persistence for task Download_Movies to db.
2021-02-19 16:49:39 DEBUG    task_queue                    task queue shut down
2021-02-19 16:49:39 INFO     ipc.rpyc                      server has terminated
2021-02-19 16:49:39 INFO     ipc.rpyc                      listener closed
2021-02-19 16:49:39 DEBUG    util.simple_persistence                 Flushing simple persistence for task None to db.
2021-02-19 16:49:39 DEBUG    manager                       Shutting down
2021-02-19 16:49:39 DEBUG    manager                       Removed /home/Name/flexget/flexget-dev/.config-lock

To Do:

  • Update Wiki

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Feb 19, 2021

I see now that It's returning errors in github validating the schema, but locally I don't have any kind of errors!

append = True
break

if not append:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using a control variable, you can use the else clause for the for loop that will be called if it reached its end (without breaking or returning earlier)


#Check Types
if types:
if message['message']['chat']['type'] not in types:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please merge if conditions

break

#Append the entry
if append:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the for/else pattern instead of a control variable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't use the else here because I need to run the complete loop break it if any check fails! The else in this case will make the code more complicated, because I would need to append the entry in the else of the for, and then in the case of no entry_config is informed

@liiight
Copy link
Copy Markdown
Member

liiight commented Feb 21, 2021

It's unclear to me what kind of data this plugin will be used to pass into the task

@paranoidi
Copy link
Copy Markdown
Member

Naming is not following convention. We don't use "input" as a part of plugin name.

entry:
<field>: <regexp to match value>

Note: If not declated, title will be the message
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Feb 22, 2021

14+ reviews! Noob alert! 😊

This is my first time playing with python, I'm still catching up on some conventions! I'll review all comments tomorrow! Thank you!

append = False
for i in whitelist:
if 'username' in i and i['username'] == message['message']['from']['username']:
logger.debug("WhiteListing: Username {}",message['message']['from']['username'])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you repeatedly use long access like message['message']['from']['username'], please extract that into local variable instead.

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Feb 24, 2021

I reviewed the code and I'll add relevante notes in the change requests as comments

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Feb 24, 2021

Naming is not following convention. We don't use "input" as a part of plugin name.

I renamed the task to "from_telegram" I can't use only telegram because a plugin with that name already exists in the notify!

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Feb 24, 2021

It's unclear to me what kind of data this plugin will be used to pass into the task

Basically anything that you desire... You can ask to download a movie based on name, add a new series to a entry list, forget a episode, run a task.... It's all a mater of matching the correct statement and execute the task based on that.

One thing that would be great is to this plugin to inform the telegram from notify of the target to where send a notification. That way you could ask for something in this plugin and then receive the notification in the same chat! That way anyone autorized could chat with flexget and request something. That integration can be added later

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Mar 1, 2021

@liiight and @paranoidi code and rename ready for review, when you have the time for it!

Thank you

Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, a few more changes requested

only_new = config['only_new']
entry_config = config.get('entry')
whitelist = config.get('whitelist',[])
types = config.get('types')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can set the default here:

Suggested change
types = config.get('types')
types = config.get('types', ['private', 'group'])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

types = ['private', 'group']

#Get Last Checked ID
update_id = task.simple_persistence.get(token+'_update_id')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fstring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

).json()
except HTTPError as e:
raise plugin.PluginError("Error getting telegram update: {}" % e)
return
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to return after raise, it's unreachable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!


#We have a error
if not response['ok']:
raise plugin.PluginError("Telegram updater returned error {}: {}" % (response['error_code'], response['description'] ) )
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't a logger, please use fstring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

task.simple_persistence[token+'_update_id'] = update_id

#We Don't care if it's not a message or no text
if 'message' not in message or 'text' not in message['message'] or 'chat' not in message['message'] or 'type' not in message['message']['chat']:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is way too long, please run black

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black was run

entry['title'] = text

#We need a url, so we add a dummy
entry['url'] = "http://localhost?update_id="+str(update_id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fstring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

entry['telegram_message'] = message['message']

#Check Types
if types and message['message']['chat']['type'] not in types:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check should probably happen sooner

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit sooner! Done!

#Process the entry config
accept = True
if not entry_config:
pass
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the pass! Done!

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Mar 10, 2021

All reviews done! Hope that all is ok now! Tks

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Mar 10, 2021

Run black in the plugin

Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job dude, almost there ;-)
Please go over all string appending, use fstrings everywhere except log messages

types = config.get('types', ['private', 'group'])

# Get Last Checked ID
update_id = task.simple_persistence.get('{}_update_id'.format(token))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fstrings

Suggested change
update_id = task.simple_persistence.get('{}_update_id'.format(token))
update_id = task.simple_persistence.get(f'{token}_update_id')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I released now that I was using a older fstring format, this one is much better. Tks

params['offset'] = update_id

# The Target URL
url = "{domain}bot{token}/getUpdates".format(domain=_TELEGRAM_API_URL, token=token)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fstring

Suggested change
url = "{domain}bot{token}/getUpdates".format(domain=_TELEGRAM_API_URL, token=token)
url = "f{_TELEGRAM_API_URL}bot{token}/getUpdates"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

try:
response = task.requests.get(url, timeout=60, raise_status=False, params=params).json()
except HTTPError as e:
raise plugin.PluginError("Error getting telegram update: {}".format(e))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fstring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@soloam
Copy link
Copy Markdown
Contributor Author

soloam commented Mar 10, 2021

Done!!..... 😅

@soloam soloam requested a review from liiight March 10, 2021 17:26
Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work on this dude!


# Get Telegram Updates
try:
response = task.requests.get(url, timeout=60, raise_status=False, params=params).json()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed this, but if you set raise_status=False it won't raise an exception here. you need to set it to True (which is the default I think)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done @liiight ! Tks for the time spend on this

@liiight liiight changed the title Add Telegram Input Plugin [add] Add Telegram Input Plugin Mar 14, 2021
@liiight liiight merged commit 7fbe39c into Flexget:develop Mar 14, 2021
@liiight
Copy link
Copy Markdown
Member

liiight commented Mar 14, 2021

Thanks for this! Could you please update the wiki?

@soloam soloam deleted the telegram_input branch May 25, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants