added inactive following dvm

This commit is contained in:
Believethehype
2023-11-30 10:49:08 +01:00
parent dd1b69bc0b
commit fccaffa9fc
8 changed files with 234 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ from utils.nostr_utils import get_event_by_id
def input_data_file_duration(event, dvm_config, client, start=0, end=0):
#print("[" + dvm_config.NIP89.NAME + "] Getting Duration of the Media file..")
input_value = ""
input_type = "url"
input_type = ""
for tag in event.tags():
if tag.as_vec()[0] == 'i':
input_value = tag.as_vec()[1]

View File

@@ -1,4 +1,5 @@
from datetime import timedelta
from hashlib import sha256
from nostr_sdk import Tag, Keys, EventBuilder, Filter, Alphabet, PublicKey, Event
@@ -15,10 +16,13 @@ class NIP89Config:
def nip89_create_d_tag(name, pubkey, image):
import hashlib
m = hashlib.md5()
m.update(str(name + image + pubkey).encode("utf-8"))
d_tag = m.hexdigest()[0:16]
#import hashlib
#m = hashlib.md5()
#m.update(str(name + image + pubkey).encode("utf-8"))
#d_tag = m.hexdigest()[0:16]
key_str = str(name + image + pubkey)
d_tag = sha256(key_str.encode('utf-8')).hexdigest()[:16]
return d_tag