From acb59168d539eddda768d7966bd40b58317eae0d Mon Sep 17 00:00:00 2001 From: Believethehype Date: Tue, 6 Feb 2024 19:54:09 +0100 Subject: [PATCH] fix users tag in search --- nostr_dvm/tasks/advanced_search.py | 4 +++- nostr_dvm/tasks/advanced_search_wine.py | 3 ++- nostr_dvm/tasks/discovery_nonfollowers.py | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nostr_dvm/tasks/advanced_search.py b/nostr_dvm/tasks/advanced_search.py index fa3a693..e080c10 100644 --- a/nostr_dvm/tasks/advanced_search.py +++ b/nostr_dvm/tasks/advanced_search.py @@ -110,7 +110,9 @@ class AdvancedSearch(DVMTaskInterface): search_until = Timestamp.from_secs(int(options["until"])) userkeys = [] for user in options["users"]: - user = user[1] + tag = Tag.parse(user) + user = tag.as_vec()[1] + #user = user[1] user = str(user).lstrip("@") if str(user).startswith('npub'): userkey = PublicKey.from_bech32(user) diff --git a/nostr_dvm/tasks/advanced_search_wine.py b/nostr_dvm/tasks/advanced_search_wine.py index b56323f..7dec38a 100644 --- a/nostr_dvm/tasks/advanced_search_wine.py +++ b/nostr_dvm/tasks/advanced_search_wine.py @@ -91,7 +91,8 @@ class AdvancedSearchWine(DVMTaskInterface): options = DVMTaskInterface.set_options(request_form) userkeys = [] for user in options["users"]: - user = user[1] + tag = Tag.parse(user) + user = tag.as_vec()[1] user = str(user).lstrip("@") if str(user).startswith('npub'): userkey = PublicKey.from_bech32(user) diff --git a/nostr_dvm/tasks/discovery_nonfollowers.py b/nostr_dvm/tasks/discovery_nonfollowers.py index 5b062a0..1d1e36d 100644 --- a/nostr_dvm/tasks/discovery_nonfollowers.py +++ b/nostr_dvm/tasks/discovery_nonfollowers.py @@ -66,8 +66,9 @@ class DiscoverNonFollowers(DVMTaskInterface): keys = Keys.from_sk_str(sk.to_hex()) signer = ClientSigner.keys(keys) cli = Client.with_opts(signer, opts) - for relay in self.dvm_config.RELAY_LIST: - cli.add_relay(relay) + cli.add_relay("wss://relay.nostr.band") + #for relay in self.dvm_config.RELAY_LIST: + # cli.add_relay(relay) cli.connect() options = DVMTaskInterface.set_options(request_form)