def index(self): form = url_Form(request.form) if request.method == "POST": # a=form._url.data url_from_admin = form.url_my # print(form.link_downland.data) # add_url = pharser_app('https://play.google.com/store/apps/details?id=%s' %url_from_admin.data) add_url = pharser_app("https://play.google.com/store/apps/details?id=%s" % url_from_admin.data) # print('https://play.google.com/store/apps/details?id=%s'%url_from_admin.data) print(add_url) # if 'Not Found' in add_url: # print('y') if db.session.query(apps_kosher).filter_by(id_google_play=url_from_admin.data).count() > 0: flash("app exist", category="error") elif any("Not Found" in i for i in add_url if i != None): flash("Not Found", category="error") else: apps = apps_kosher( add_url[0], add_url[1], add_url[2], add_url[3], add_url[4], add_url[5], add_url[6], add_url[7], None, url_from_admin.data, ) db.session.add(apps) db.session.commit() flash("success", category="success") return self.render("add_apps.html", form=form)
def my_trread(url_from_admin): return pharser_app("https://play.google.com/store/apps/details?id=%s" % url_from_admin.data)