Skip to content

Commit

Permalink
More details.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Nov 2, 2023
1 parent 8a34bbe commit 9b6aa65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/npoapi/bin/npo_check_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
"""
from npoapi.media import Media


def check_credentials():

client = Media().command_line_client(
description="Get an media object from the NPO Frontend API using provided credentials. This lets you easily "
"check whether new credentials do work")

client.add_argument('apikey', type=str, nargs=1, help='key')
client.add_argument('apisecret', type=str, nargs=1, help='secret')
client.add_argument('origin', type=str, nargs=1, help='origin')
client.add_argument('mid', type=str, nargs='?', help='mid', default="WO_NCRV_026201")

args = client.parse_args()

client.login(args.apikey[0], args.apisecret[0], args.origin[0])

mid = args.mid

print(client.get(mid))
client.exit()


if __name__ == "__main__":
check_credentials()
check_credentials()
2 changes: 1 addition & 1 deletion src/npoapi/bin/npo_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def subtitles():
client = Subtitles().command_line_client(description="Set subtitles")
client.add_argument('mid|text', type=str, nargs=1, help='The mid for wich subtitles to get. Or form description')
client.add_argument('-S', '--search', action='store_true',
help="""The argument is interpreted as a text to search on""")
help="""The argument is interpreted as a text to search on""")
client.add_argument('language', type=str, nargs='?', default="nl", help='Language. Required when getting mid')
client.add_argument('type', type=str, nargs='?', default="CAPTION", help='', choices={"CAPTION", "TRANSLATION"})

Expand Down

0 comments on commit 9b6aa65

Please sign in to comment.