bandcamp-discover 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 578c9fcd2d141d3d4aae12681311bd343ce7ba4b91db81eaaa509b2e77766b5b
|
|
4
|
+
data.tar.gz: '0957546c5684706eccad5234387da685445c411838c1637a87acea190d3509c7'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 011ee30c00a404c2d4a1e2dfcdb411062da50eced9c5b3c7d026a2259dbd89b9e21f902cae2d3e9829e0ff38be8acc1d9b63d9265f41697975a1e6eb4ab329d7
|
|
7
|
+
data.tar.gz: b5f7d1c16c99e10aa66c65c0af18f7d604d88fc6bddf0979fcece9e8f433ea24a8cfed0db09348f70e044eeba5d93b3bc33151bf65c53e58ba8fe19a9bb4b364
|
|
@@ -27,5 +27,28 @@ module BandcampDiscover
|
|
|
27
27
|
@description.match? /label|platform|records/i
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
def accepts_demos?
|
|
32
|
+
if defined?(OpenRouter) && !!OpenRouter.configuration.access_token
|
|
33
|
+
response = OpenRouter::Client.new.complete(
|
|
34
|
+
[
|
|
35
|
+
{ role: "system", content: "You are given a description of a record label or music platform. Analyze if they accept demo submissions from artists. Look for mentions of 'demos', 'demo submissions', 'send demos', 'submit music', 'accepting submissions', contact information for demos, or similar language. Answer with a JSON object {\"answer\": true|false}." },
|
|
36
|
+
{ role: "user", content: @description }
|
|
37
|
+
],
|
|
38
|
+
model: [
|
|
39
|
+
@model
|
|
40
|
+
],
|
|
41
|
+
extras: {
|
|
42
|
+
response_format: {
|
|
43
|
+
type: "json_object"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
JSON.parse(response["choices"][0]["message"]["content"])["answer"]&.to_s&.downcase == "true"
|
|
49
|
+
else
|
|
50
|
+
false
|
|
51
|
+
end
|
|
52
|
+
end
|
|
30
53
|
end
|
|
31
54
|
end
|
|
@@ -8,13 +8,13 @@ module BandcampDiscover
|
|
|
8
8
|
super do |page|
|
|
9
9
|
page.goto(@url)
|
|
10
10
|
|
|
11
|
-
title = page.query_selector("meta[name=title]")&.
|
|
11
|
+
title = page.query_selector("meta[name=title]")&.[](:content)
|
|
12
12
|
|
|
13
13
|
# querying all tags in the bottom and returning their text node
|
|
14
14
|
tags = page.query_selector_all("a.tag")
|
|
15
15
|
tags.map!(&:inner_text)
|
|
16
16
|
|
|
17
|
-
player = page.query_selector("meta[property='og:video']")&.
|
|
17
|
+
player = page.query_selector("meta[property='og:video']")&.[](:content)
|
|
18
18
|
|
|
19
19
|
[@url, title, tags, player]
|
|
20
20
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bandcamp-discover
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julian RUbisch
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-01-28 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rake
|