Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -428,10 +428,16 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
428 |
return result,image
|
429 |
|
430 |
def scrap(link_scrap,backlink,keyword,openai_key,replicate_key):
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
# tags, content, url, img, image_data = artikel_processing(contents, url, title)
|
436 |
# return result
|
437 |
|
|
|
428 |
return result,image
|
429 |
|
430 |
def scrap(link_scrap,backlink,keyword,openai_key,replicate_key):
|
431 |
+
try:
|
432 |
+
data,gambar= artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key)
|
433 |
+
judul = data['Judul Artikel'][0]
|
434 |
+
kontent = data["Konten Artikel"][0]
|
435 |
+
return gambar,judul,kontent
|
436 |
+
except:
|
437 |
+
gambar = Image.open('error.png')
|
438 |
+
judul = 'Gagal Generate Judul:Limit Token OpenAI'
|
439 |
+
kontent = 'Gagal Generate Artikel:Limit Token OpenAI'
|
440 |
+
return gambar,judul,kontent
|
441 |
# tags, content, url, img, image_data = artikel_processing(contents, url, title)
|
442 |
# return result
|
443 |
|