mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Configurable scraper user agent string (#409)
* Add debug scrape option. Co-authored-by: HiddenPants255 <>
This commit is contained in:
@@ -29,6 +29,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
||||
const [logLevel, setLogLevel] = useState<string>("Info");
|
||||
const [logAccess, setLogAccess] = useState<boolean>(true);
|
||||
const [excludes, setExcludes] = useState<string[]>([]);
|
||||
const [scraperUserAgent, setScraperUserAgent] = useState<string | undefined>(undefined);
|
||||
|
||||
const { data, error, loading } = StashService.useConfiguration();
|
||||
|
||||
@@ -44,7 +45,8 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
||||
logOut,
|
||||
logLevel,
|
||||
logAccess,
|
||||
excludes
|
||||
excludes,
|
||||
scraperUserAgent
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -66,6 +68,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
||||
setLogLevel(conf.general.logLevel);
|
||||
setLogAccess(conf.general.logAccess);
|
||||
setExcludes(conf.general.excludes);
|
||||
setScraperUserAgent(conf.general.scraperUserAgent ?? undefined);
|
||||
}
|
||||
}, [data, error]);
|
||||
|
||||
@@ -289,6 +292,22 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
||||
|
||||
<hr />
|
||||
|
||||
<Form.Group id="generated-path">
|
||||
<h6>Scraping</h6>
|
||||
<Form.Control
|
||||
className="col col-sm-6 text-input"
|
||||
defaultValue={scraperUserAgent}
|
||||
onChange={(e: React.FormEvent<HTMLInputElement>) =>
|
||||
setScraperUserAgent(e.currentTarget.value)
|
||||
}
|
||||
/>
|
||||
<Form.Text className="text-muted">
|
||||
User-Agent string used during scrape http requests
|
||||
</Form.Text>
|
||||
</Form.Group>
|
||||
|
||||
<hr />
|
||||
|
||||
<Form.Group>
|
||||
<h4>Authentication</h4>
|
||||
<Form.Group id="username">
|
||||
|
||||
Reference in New Issue
Block a user