Dede16 commited on
Commit
a09734b
·
1 Parent(s): 7b1359e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
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
- data,gambar= artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key)
432
- judul = data['Judul Artikel'][0]
433
- kontent = data["Konten Artikel"][0]
434
- return gambar,judul,kontent
 
 
 
 
 
 
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